Files
osmedeus/test/testdata/workflows/test-exports-functions.yaml
T
j3ssie 7de3e7b2b2 feat: add performance optimizations and robustness improvements
- Add lock-free ResultCollector for parallel execution with atomic operations, eliminating mutex contention for pre-allocated slices
- Implement circuit breaker pattern (internal/retry/circuit_breaker) with configurable thresholds and half-open recovery state for fault tolerance
- Introduce json-iterator replacement (internal/json) for 2-6x faster JSON operations while maintaining stdlib compatibility
- Add lazy template rendering (RenderLazy) with variable reference caching for 50-80% faster rendering on large contexts
- Implement memory-efficient buffer pooling (bufpool) with 10MB pre-allocated reusable buffers for reduced GC pressure
- Add LoadFlowWithModules for parallel module pre-loading using errgroup, improving startup time for complex flows
- Add VarRefCache with LRU eviction for variable extraction caching
- Add streaming output support for foreach loops to process large datasets without memory accumulation
- Fix json import compatibility in llm_executor and db_functions
- Update test fixtures with correct YAML field names (call→function, run→command)
2026-01-31 01:26:28 +07: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_result: "file_exists('{{outputFile}}')"
- name: test-fileexists-false
type: bash
command: echo "Checking nonexistent"
exports:
missing_file_result: "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_result}}"
echo "Missing file: {{missing_file_result}}"
echo "Replaced: {{replaced_output}}"
echo "=== All Exports Verified ==="