# tracecat workflow run <wf_id> --test
tests:
# If an action has a test, do not run the action and mock/patch the output
- ref: pull_crowdstrike_alerts
enable: true # default: true
validate_args: true # default: true
# Path (use fsspec to support both local files and http)
# to sample JSON or YAML content (to be JSONfied)
success: # This is the mocked/patched output for the action.
failure: # TODO
config:
# Statically configure this here, or omit this and pass it in at execution time
enable_runtime_tests: true
Features
Adds new top-level workflow directive tests
Define a list of tests that mock the output value of actions at runtime
By default, all tests defined are enabled. You can control whether they're enabled or disabled at runtime.
You can override any action with any data structure
You can load mock data using fsspec compliant uris/paths
Add custom headers module
Pass --test (CLI) or X-Tracecat-Enable-Runtime-Tests: true` (http) to enable runtime action tests
At execution time, for incoming webhooks we check for X-Tracecat-Enable-Runtime-Tests header and set DSLConfig in the workflow input. Otherwise, this config can be statically configured in the config directive.
API
Features
tests
tests
that mock the output value of actions at runtimefsspec
compliant uris/paths--test
(CLI) or X-Tracecat-Enable-Runtime-Tests: true` (http) to enable runtime action testsX-Tracecat-Enable-Runtime-Tests
header and setDSLConfig
in the workflow input. Otherwise, this config can be statically configured in theconfig
directive.Testing