Documentation
¶
Overview ¶
Package testkit provides flow-runner-specific test helpers.
This package is intentionally separate from github.com/nexssp/testkit: the generic testkit has no dependency on flow, and this package needs one. Keeping them apart means a project that never runs flows does not pull flow into its test binaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
Result captures the outcome of one flow run inside a test.
Stdout and Stderr hold the exact bytes the runner would have written to the terminal, so a test can assert on the live trace, the metrics table, or the banner without spawning a subprocess.
func RunDSL ¶
RunDSL executes a flow body directly, without reading a .nflow file.
The DSL is treated as if it were the content of a .nflow file: it may contain @config, @pipeline, and @assert directives, but not @include or @require (those need a real file on disk).
payload is passed as the initial state. libs is the library set the DSL may call; pass at least flow.StandardLibrary().
Stream atoms (fs.walk, fs.read, out.file, …) live in the flow registry, not the action registry. RunDSL builds a flow registry from the same libraries and passes it to CompilePipeline via WithFlowRegistry, so stream pipelines route through the pipeline compiler instead of failing in the DAG path.
func (Result) ExpectFailure ¶
ExpectFailure fails the test when the flow exited with code 0.
func (Result) ExpectSuccess ¶
ExpectSuccess fails the test when the flow did not exit cleanly.