Files
osmedeus/test/testdata/workflows/test-exports-functions.yaml
T
j3ssie 1403d20a4d feat: add LLM step executor with vision and tool support, event workflow system, and inheritance
- Add LLM executor supporting OpenAI vision, tool calling, embeddings, and structured outputs
- Introduce event emitter/receiver workflows with deduplication and filtering (generate_event functions)
- Add workflow extends/override system enabling inheritance chains and step merge modes
- Update function naming to snake_case across all testdata (fileExists→file_exists, etc.)
- Add comprehensive test fixtures for linter, events, CDN, step dependencies, and extends workflows
2026-01-20 18:23:57 +08:00

82 lines
2.2 KiB
YAML

name: test-exports-functions
kind: module
description: Test exports with utility functions like file_length, contains, file_exists, replace
tags: test,exports,functions,utility
params:
- name: target
required: true
- name: outputFile
type: string
default: "{{Output}}/test-output.txt"
- name: trimTestFile
type: string
default: "{{Output}}/trim-test.txt"
- name: replaceTestFile
type: string
default: "{{Output}}/replace-test.txt"
steps:
- name: setup
type: bash
commands:
- mkdir -p {{Output}}
- printf 'line1\nline2\nline3\nline4\nline5\n' > {{outputFile}}
- printf ' trimmed_value ' > {{trimTestFile}}
- printf 'hello,world,test' > {{replaceTestFile}}
- name: test-filelength
type: bash
command: echo "Checking file length"
exports:
line_count: "file_length('{{outputFile}}')"
- name: test-trim
type: bash
command: echo "Checking trim"
exports:
trimmed_output: "trim(read_file('{{trimTestFile}}'))"
- name: test-contains-success
type: bash
command: echo "Checking contains"
exports:
has_success: "contains('success_completed', 'success')"
- name: test-contains-failure
type: bash
command: echo "Checking contains"
exports:
has_failure: "contains('success_completed', 'failure')"
- name: test-fileexists-true
type: bash
command: echo "Checking existence"
exports:
file_exists: "file_exists('{{outputFile}}')"
- name: test-fileexists-false
type: bash
command: echo "Checking nonexistent"
exports:
missing_file: "file_exists('{{Output}}/nonexistent.txt')"
- name: test-replace
type: bash
command: echo "Checking replace"
exports:
replaced_output: "replace(read_file('{{replaceTestFile}}'), ',', '-')"
- name: final-summary
type: bash
command: |
echo "=== Exports Functions Summary ==="
echo "Trimmed: [{{trimmed_output}}]"
echo "Line count: {{line_count}}"
echo "Has success: {{has_success}}"
echo "Has failure: {{has_failure}}"
echo "File exists: {{file_exists}}"
echo "Missing file: {{missing_file}}"
echo "Replaced: {{replaced_output}}"
echo "=== All Exports Verified ==="