Workflow Test Reference
This page lists every field of a workflow test file, the errors dagu test reports, and its report formats. Workflow Tests shows how to write and run tests. dagu schema test prints the JSON Schema of the same fields.
The Test File
| Field | Required | Meaning |
|---|---|---|
dag | No | Path of the tested DAG file. A relative path resolves from the directory that holds the test file. Defaults to the DAG beside the test file. |
params | No | Run parameters for every case, by name. |
env | No | DAG-level env entries for every case, by name. |
secrets | No | Values for DAG secrets entries, by name, and for SSH credential refs, by ref. Needed only in a case with a real step. |
mocks | No | Mocks for every case, by step key. |
default_mock | No | A mock for every step and handler that needs one and that mocks and real do not name. |
real | No | Step keys of the steps that run their real action in every case. |
cases | Yes | The cases. Must not be empty. |
A test file accepts only the fields on this page, at every level. The keys of params, env, secrets, mocks, outputs, expect.steps, and review.values are names, not fields.
Cases
| Field | Required | Meaning |
|---|---|---|
name | Yes | Name of the case. Not empty, and unique in the file. |
params | No | Merged over the file's params, by name. |
env | No | Merged over the file's env, by name. |
scheduled_at | No | Schedule slot of the run, in the forms dagu dry --scheduled-at takes. The run gets that slot's schedule time and window. |
trigger | No | context.trigger.type of the run: manual (default), scheduler, webhook, retry, catchup, restart, backfill, or file. It changes nothing else. |
precondition | No | met or not_met: the outcome of the DAG-level preconditions that run a command or a substituting eval. Valid only when the DAG has one. |
mocks | No | Replaces the file's mock of each step it names, as a whole. |
default_mock | No | Replaces the file's default_mock. |
real | No | Added to the file's real. |
expect | Yes | Assertions. |
paramsandenvvalues are YAML scalars.- Each
paramsentry is onename=valueassignment, asdagu start -- name=valuetakes it. A case whose paramsdagu startwould reject is invalid. A param given a value does not run itseval. - An
enventry replaces the DAG's entry of the same name, or adds one. Its value is used as written, without variable expansion. - A file key and a case key that name the same step, one by
nameand one byid, name one step.
Step Keys
A step key names a step or handler in mocks, real, and expect.steps:
- the
idornameof a step of the tested DAG's first document; handler_on.<event>for a lifecycle handler:init,success,failure,abort,exit, orwait, including a handler that the base configuration adds.
A key that names no step or handler, or two keys of one map or list that name the same step, make the case invalid. Steps of other documents in the DAG file and foreach body steps have no key.
Mocks
Result Fields
| Field | Default | Meaning |
|---|---|---|
exit_code | 0 | Exit code of the execution. A non-zero code fails the attempt. |
stdout | empty | Written to the step's stdout exactly as given. Dagu adds no newline. |
stderr | empty | Written to the step's stderr exactly as given. |
outputs | none | Named outputs the execution publishes. See Mocked outputs. |
condition | none | met or not_met: the outcome of the step's command-check repeat_policy.condition after this execution. |
results | none | One result per execution. Each item takes the fields above, except results. |
- A mock with inline result fields is a one-item
results. A mock sets either, not both, andresultsmust not be empty. - The first attempt takes the first result, and each retry and each repeat iteration takes the next. After the last result, each later execution takes the last result again. A mocked step that repeats without a
limitstops after its last result instead. - A result field that a result leaves out takes its default.
- Mock results keep counting across the run attempts of a DAG-level
retry_policy.
Step Fields
| Field | Meaning |
|---|---|
precondition | met or not_met: the outcome of each of the step's preconditions that runs a command or a substituting eval, after negate applies, decided once per step start. Valid only on a step that has one. |
review | How each wait of the step is settled. Valid only on a step that waits for a person. |
Step fields sit beside results or the inline result fields, never inside a results item.
Review
| Field | Required | Meaning |
|---|---|---|
decision | Yes | approve or reject. Settles every wait of the step. |
values | No | The completion input of a human.task, or the inputs of an approval gate. |
- A
human.tasktakes onlyapprove. Itsvaluesare typed as--inputs-jsontypes them and must pass its form. Its outputs come from them. - An
approvalgate takesapproveorreject.rejectends the step and the runrejected. Each value is a scalar.valuesmust give every nameapproval.requiredlists, and an empty value counts as left out. - A wait that needs no values is approved automatically when the step's mock sets no
review.
Replaced Actions
- A mock replaces the step's action when it sets a result field.
- A mock that sets no result field also replaces the action of a step that is not real and whose action has side effects. The step then succeeds with no output.
- A mock that sets only step fields keeps the real action of a step with a side-effect-free action, and of a real step.
- A mock that sets a result field on a real step or on a
human.taskstep makes the case invalid. - A replaced step starts no process, opens no connection, creates no container, and reads no file, including its
stdinand anoutputentry withfrom: file.
The side-effect-free actions are router.route, outputs.write, log.write, and noop. A foreach step is side-effect free when every body step is.
Mocked Outputs
A step has known outputs when its output names are known before the run: the names its outputs, output_schema, object-form output, stdout.outputs, and action declare. A step whose output names are known only during a run, such as a dag.run, parallel, or manifest-resolved action step, has runtime outputs.
outputsneeds a step with anid.- A result with exit code 0 under
mockssets every known output and no other name. On a step with runtime outputs, it may set any name that matches^[A-Za-z][A-Za-z0-9_]*$. - A
type: stringoutput, the default, takes a YAML string. Atype: jsonoutput takes any YAML value, published as JSON. Any other output publishes a YAML string as written and any other value as JSON. - A result with a non-zero exit code publishes no outputs.
- Dagu does not parse
stdoutor read a file to publish outputs, and it does not checkoutput_schemaagainst mocked values.
The Default Mock
default_mock takes the fields of a mock and applies to every step and handler that has a fail-closed source and that mocks and real do not name.
- On a step whose action has side effects, it replaces the action as
{}does, with its result fields when it sets any. - On a step with a side-effect-free action, it replaces the action only when it sets a result field and the step reads a file through
output, repeats without a limit, or has a command repeat condition that its results decide withcondition. preconditionapplies to a step with a command or substitutingevalprecondition,conditionto a step with a command repeat condition, andreviewto a wait that needs values. A field that handles none of a step's sources does not apply to it.- It sets no
outputs. A step it replaces publishes each known output as an empty string, ornullfor atype: jsonoutput. - It does not handle DAG-level preconditions,
params[].eval, secrets, or the child DAG of a real step.
Assertions
| Field | Meaning |
|---|---|
status | Run status: succeeded, failed, aborted, partially_succeeded, or rejected. |
attempts | Run attempts, counting retries of a DAG-level retry_policy. |
steps.<key> | A step status, or a map with one or more of status, attempts, outputs, stdout, stderr, and called_with. |
steps.<key>.status | succeeded, failed, aborted, skipped, partially_succeeded, rejected, or not_started. |
steps.<key>.attempts | Executions of the step's action in every run attempt, counting retries and repeat iterations. |
steps.<key>.outputs | Expected named outputs, by name. |
steps.<key>.stdout, steps.<key>.stderr | A map with contains, matches, or both. |
steps.<key>.called_with | What the step's last execution was called with: run, with, env, or several. See Called With. |
notifications | The notifications the run would have sent. |
expectholds at least one assertion. An emptysteps.<key>map, an unknown step key or status, and a negativeattemptsmake the case invalid.- A step or handler that never started is
not_started. A step whose action never ran, such as a skipped step, has 0 attempts, and so does ahuman.taskstep. - A case passes when the run reaches a terminal status and every assertion holds. The report lists every failed assertion.
Outputs. A string output matches a YAML string when its text equals the string. A type: json output, or an expected value that is not a string, matches by the JSON rule: an object matches when every key it lists has a matching value, recursively, and keys it does not list are ignored. Arrays and scalars match only an equal value, and numbers compare by value. An output the step did not publish does not match. On a step with known outputs, an assertion on another name makes the case invalid.
Streams. contains holds when the stream contains its text. matches holds when its RE2 regular expression matches anywhere in the stream. The stream is the step's stdout or stderr of its last execution, as the step's log holds it, with secrets masked. A step with no execution fails a stream assertion. An invalid matches expression makes the case invalid.
Notifications. Each item has kind: mail_on.failure, mail_on.success, mail_on.wait, or mail_on_error. It may set to, a list of recipients compared as a set, and, with mail_on_error only, step. The list holds when the run would have sent as many notifications as it lists, and each item pairs with a different one, in any order. notifications: [] asserts that the run would send none. Without notifications, notifications are not checked.
Called With
called_with checks the call of a step's last execution: the values Dagu resolved for its action, before the action ran or its mock replaced it. It holds for mocked and real steps alike.
| Field | Meaning |
|---|---|
run | The resolved command or script of a step written with run. A string matches it exactly. A map takes contains, matches, or both, as a stream assertion does. |
with | The resolved inputs of a step written with action, by name. |
env | The variables the step's action receives, by name. |
- The last execution is the latest execution of the step's action in every run attempt. A step with no execution, such as a skipped step or a handler that never ran, fails
called_withonce, whatever it lists. runis the script of a multi-linerun, the command of a one-linerunwithout leading and trailing whitespace, or the commands of a list-formrun, one per line, each resolved as in a real run. Dagu-owned references such as${steps.<id>.outputs.<name>},${params.<name>}, and${env.<name>}take their values.$NAMEand${NAME}stay as written for the shell, except where Dagu resolves them, such as inside a single-quoted span.withholds the inputs as the step writes them, each resolved as the action resolves it. For a custom action, they are the inputs the step passes, not the fields of its definition. Only the listed inputs are checked. A string matches an input whose text equals it, and any other value matches by the JSON rule of outputs, against the input's text read as JSON: listed keys only, recursively. An input the step does not set does not match.envholds every variable the action receives: the host variables that Dagu passes to steps, which are its fixed allowlist, such asPATHandHOME, and the namesenv_passthroughandenv_passthrough_prefixesadd, the DAG's and the step'senv, and secrets. A host variable that Dagu does not pass, such as anAWS_SECRET_ACCESS_KEYthatenv_passthroughdoes not name, is not set. Only the listed names are checked, each against its exact text. A variable that is not set does not match.- A secret compares as the step saw it: its placeholder
<secret:NAME>in a case without a real step, and its value undersecretsin a case with one. The report masks it as*******.
These make the case invalid, each with an error under its field:
| Mistake | Error |
|---|---|
run on a step written with action | the step runs action <action>, which takes no run; assert with |
with on a command step | the step runs a command, which takes no with; assert run |
with on another step not written with action, such as one written with the deprecated type field | the step is not written with action, so it takes no with |
run on a step with no command or script, such as one written with type | the step has no command or script |
called_with on a human.task step | a human.task step has no action to call |
called_with on a foreach step | a foreach step calls only its body steps, which have no step key |
called_with on a step with nodes | a step with nodes resolves its command in the child run of each node; assert on the child DAG's steps |
An empty called_with, with, or env | holds no assertion |
A run map without contains or matches | must set contains, matches, or both |
A matches value that is not RE2 | is not a valid RE2 expression: ... |
Fail-Closed Sources
A case is invalid, and none of its steps runs, while the DAG has a source in this table that the case does not handle. The rule covers every step and handler, reached or not.
| Error label | Source | Handled by |
|---|---|---|
param <name> | A params[].eval with command substitution | A value under params |
secret <name> | A DAG secrets entry or an SSH credential ref, in a case with a real step | A value under the test file's secrets |
precondition | A DAG-level precondition with a command check or a substituting eval | The case's precondition |
step <step> | A step action with side effects | A mock, {} and the default mock included, or the step under real |
step <step> | A step precondition with a command check or a substituting eval | precondition in the step's mock, or the step under real |
step <step> | A command-check repeat_policy.condition | condition in every result of the step's mock, or the step under real |
step <step> | An object-form output entry with from: file | A mock that replaces the action, or the step under real |
step <step> | A side-effect-free step that repeats without a limit | A mock that sets a result field, or the step under real |
step <step>, body step <body> | A foreach body step with any source above | A mock of the foreach step |
step <step> | A wait that needs values | review in the step's mock, also for a real step |
handler_on.<event> | A source above on a lifecycle handler | The same, keyed by handler_on.<event> |
step <step>, child <dag>, ... | A source above in the child DAG of a real step | Nothing. Mock the parent step |
<step>and<body>are the step'sid, or itsnamewhen it has none.- The errors list params, secrets, DAG-level preconditions, steps in DAG order, then handlers.
- A wait needs values when completing it with none would fail: a
human.taskwhose form has arequiredproperty without adefault, or anapprovalwithrequiredinputs.
The Fix
An invalid case ends with fix, ready to paste: and the case fields that handle every listed source, in the order params, precondition, mocks. Missing secrets follow under fix for the test file, ready to paste:. Each source adds:
| Source | Entry |
|---|---|
A step action with side effects, or a foreach body step | {} on the step or its foreach step, with outputs set to "" for each known output, or null for a type: json one |
An output with from: file, or a step that repeats without a limit, on a side-effect-free step | exit_code: 0, with outputs as above |
| A step precondition | precondition: met in the step's mock |
| A command-check repeat condition | A condition that stops the step, not_met for while and met for until, in each result |
| A wait that needs values | review with decision: approve and a value for each required name |
| A secret or SSH credential ref | Its name under secrets with "" |
| A DAG-level precondition | The case's precondition: met |
A substituting params[].eval | The param's default, else its first enum value, else "" |
A required human.task value is its first enum or oneOf value, else "", 0, or false by type. A required approval input is TODO. A value that another form constraint, such as pattern, rejects carries the comment # replace with a value the form accepts, and the case stays invalid until it is replaced.
Other Invalid Cases
A case is also invalid when:
- a mock sets
outputsthat Mocked outputs rejects, or the default mock setsoutputs; - a mock sets
precondition,condition, orreviewon a step that has no such source; reallists aforeachstep;- a
secretskey names neither a DAGsecretsentry nor an SSH credential ref of the DAG; trigger,scheduled_at,precondition,condition, ordecisionhas a value this page does not list;expectbreaks a rule of Assertions or Called With, or anotificationsitem has an unknownkindor setsstepwithoutmail_on_error.
The error line names the field, such as mocks.build.outputs or expect.steps.deploy. The other cases of the file still run.
Invalid Test Files
A test file is invalid, and none of its cases runs, when:
- it is not valid YAML, or its top level is not a map;
- it has a field this page does not define, or a field of the wrong type;
casesis missing or empty, a case has nonameorexpect, or two cases share aname;- its first document has top-level
stepsand nocases, which reads as a DAG. The error suggests a name, such assmoke-test.yamlforsmoke.test.yaml; - the tested DAG file does not exist,
dagnames a test file, or the DAG fails to load asdagu startloads it; - the tested DAG is a
type: buildDAG.
The other test files still run.
What Changes Under Test
| Behavior | Under test |
|---|---|
Retry and repeat intervals, backoff, and delay_sec | Not waited for, except by real steps. The order and count of executions do not change. |
timeout_sec | Applies as in a real run. A replaced action returns at once. |
A DAG-level retry_policy | dagu test retries the run in the same case directory, without waiting, with the trigger type retry. |
Run history, logs, artifacts, and state | Kept in a new case directory, removed when the case ends unless --keep is set. The configured data directory is not read or written, and state starts empty. |
mail_on and mail_on_error | Not sent. The report lists each notification the run would have sent. |
| OpenTelemetry export | Off. |
stdout and stderr redirect files | Written inside the case directory, for every step that is not real. |
The DAG's working_dir, DAG-level container and ssh, tools, and native resource limits | Set up only when the case has a real step. |
| Secrets | Resolved by no provider. A placeholder <secret:NAME> without a real step, the test file's value otherwise. Both are masked. |
queue and worker_selector | Ignored. The case runs in the dagu test process. |
A case runs beside the live runs of the same DAG. Neither sees the other, and the case's run does not appear in the DAG's history. An interrupted dagu test stops the running case, starts no other, and exits with a non-zero status.
Updating Expectations
dagu test --update selects test files and cases as dagu test does, runs each selected case, and rewrites its expect from the run.
- An asserted run
statusorattempts, stepstatusorattempts, ornotificationslist that does not hold takes the run's value. An assertion that holds stays exactly as written, such astotal: 7.0against a published"7". - An asserted output takes its published value. For an object, each key it lists takes its published value, recursively, and no key is added. No output assertion is added.
- A step or handler without an assertion gains its status, and
attemptswhen above 1, after the case's last step entry, in DAG order and then handler order. A step entry keeps its form: a status stays a status, and a map keeps its fields. - A
called_withvalue that does not hold takes the step's call: arunstring takes the resolved text, each listedwithinput takes its resolved value, the listed keys only of an object, and each listed variable takes its text. A secret is written as the step saw it, such as<secret:API_TOKEN>. Nocalled_withis added. - No assertion is removed. These stay as written and still fail when they do not hold:
stdoutandstderrassertions, acalled_withrungiven ascontainsormatches, awithinput or variable that the call lacks, thecalled_withof a step with no execution, an output the step did not publish, a listed key the published object lacks, an object where the published value is not one, and a number that YAML cannot write exactly, such as an integer above 18446744073709551615. - Only the changed text is rewritten. Comments, quotes, and the other cases stay. A flow-style map or list that gains an entry is rewritten in block style.
- Each rewrite is read back before it is kept, so the file never gets invalid YAML or a value other than the run's.
- A value that holds a host value is not written, by value and as best effort. See Values From the Host.
- A test file is written once its selected cases have run, and only when an
expectchanged, through a temporary file renamed over it. It keeps its mode.
The last line under each case says what happened to its expect, whether or not the case passes:
| Text report | JSON update | Meaning |
|---|---|---|
expect updated | updated | The run changed its text. |
expect unchanged | unchanged | The run left its text as it was. |
expect kept: <reason> | kept | It stays as written whatever the run did. |
The reasons are:
the case is invalidthe run did not finish, such as a case that ran longer than--timeoutthe case is written in flow style or uses a YAML anchor, alias, or merge key, since a rewrite could change another part of the file. A flow-styleexpector list inside a block-style case is rewritten.the expect could not be rewritten in place
The report and the exit status are those of the rewritten cases. A rewritten case passes unless an assertion that stays as written fails.
A test file edited while its cases ran is not written. The other test files still run and the report ends as usual. Then an error goes to stderr, Error: <path> changed while its cases ran, so its expects were not updated, with the file's absolute path, and the command exits 1, or 2 when a case or file is invalid. An interrupt leaves the test file whose cases were running as it was.
Values From the Host
A case's run reads the host environment as a run of dagu start does. A host value is the value of a variable the run takes from the host:
- a variable that resolving the DAG and its steps reads, such as
HOST_TOKENin a DAGenventryTOKEN: ${HOST_TOKEN}, in${env.HOST_TOKEN}, or in a JSON path such as${HOST_JSON.token}; - a variable that
env_passthroughorenv_passthrough_prefixespasses to steps.
Each string and number inside a JSON host value is a host value too, and a number counts in every form it takes, so 7.36491e5 also counts as 736491. A host value, or a part of one, shorter than four characters, such as us, counts only where a value equals it, not inside text such as us-east-1. Booleans, empty values, and the variables Dagu passes to every step, its fixed allowlist such as PATH and HOME and the names that start with DAGU_, DAG_, LC_, or KUBERNETES_, are no host values.
--updatewrites no value that holds a host value: an output, acalled_withrun, awithinput, or a variable stays as written, and so does anotificationslist when a recipient of the sent ones holds one. Acalled_withvariable that the step takes straight from the host, with no DAG, step, or caseenventry in its place, stays as written too,HOMEincluded. In an object assertion, each listed key decides on its own, so the other changed keys are written.- Each kept value still fails. The text and JSON reports mask host values as
*******in the values of a failed output orcalled_withassertion. Notification recipients are written as the run resolved them. - Before the case's last line, one line per kept value reads
<label>: kept, it holds the value of host variable <names>; set <variables> under env, withthe values of host variablesfor more than one.<label>starts the assertion's failure line, such asstep sync called_with.env.TOKENornotifications.; set <variables> under envis left out when no variable of the step's call holds the value, and always fornotifications. - In JSON, the case's
update_keptlists the same, each withstepfor a step assertion,field,variables, the host variables, andenv, the variables to set, when there are any. - A case that sets an entry under
envtakes no host value for it. A DAGenventry built from another, such asAUTH: Bearer ${TOKEN}, keeps the value it took while the DAG loaded, so set each entry the line names. - The match is by value and best effort. A value derived from a host value in another form, such as the part
${HOST_TOKEN#Bearer }takes, or a re-encoding, is not matched. Keep credentials in DAGsecretsand pin other values under the case'senv.
Report
The report goes to stdout. A test file appears by its path relative to the current directory when it is under it, and by its absolute path otherwise.
Text Report
PASS <file>: <case> (<duration>),FAIL <file>: <case> (<duration>), orINVALID <file>: <case>starts each case, in run order.INVALID <file>starts an invalid test file, whose cases do not appear.- Under a case that ran, in this order: one line per failed assertion,
default mock: <steps>,approved automatically: <steps>, onenotification <kind>: <recipients>line per notification,case directory <path>with--keep, and, with--update, the update outcome. - Under an invalid case or file: one
<label>: <message>line per error, then the fix of an invalid case. - The last line is the summary:
<n> cases: <passed> passed, <failed> failed, followed by, <invalid> invalidand, <files> invalid fileswhen there are any.
A failed assertion reads, for example, status: expected succeeded, got failed, step deploy: expected skipped, got aborted, step deploy attempts: expected 3, got 1, or step count output files: expected "3", got "2". A case that runs longer than --timeout fails with timeout: did not finish within <timeout>, and its assertions are not evaluated.
A failed called_with part reads:
step <key> called_with.run: expected <text>, got <text>;step <key> called_with.run: expected to contain <text>, got <text>, orexpected to match <regexp>;step <key> called_with.with.<name>: expected <value>, got <value>, andcalled_with.env.<name>for a variable, withgot nothingwhen the call lacks it;step <key> called_with: expected a call, got none, for a step with no execution.
Values are written as JSON, with secrets and host values masked as *******, such as step notify called_with.with.headers: expected {"Authorization":"Bearer other"}, got {"Authorization":"Bearer *******"}.
JSON Report
--format json writes exactly one JSON object to stdout once every case has ended.
| Top-level field | Present | Meaning |
|---|---|---|
cases | Always | One object per case that ran or was invalid, in run order. |
invalid_files | When a test file is invalid | One object per invalid test file, with file and errors. |
| Case field | Present | Meaning |
|---|---|---|
file | Always | The test file. |
name | Always | The case name. |
result | Always | pass, fail, or invalid. |
duration_ms | When the case ran | Wall-clock time in milliseconds. |
failures | When result is fail | Failure objects, run assertions first, then steps in expect.steps order, then notifications. Within a step, called_with comes after the streams: its run, contains, and matches, then its with inputs and its variables in the order listed. |
errors | When result is invalid | Error objects: source, the label, when there is one, and message. |
fix | When an invalid case has a fix | The fix for the case, as YAML text. |
file_fix | When the fix has secrets | The fix for the test file, as YAML text. |
default_mocked | When the default mock applied | Step labels. |
auto_approved | When a wait was approved automatically | Step labels. |
notifications | When the run would have sent one | Objects with kind, to, and, for mail_on_error, step. |
case_dir | With --keep, when the case ran | Absolute path of the kept case directory. |
update | With --update | updated, unchanged, or kept. See Updating expectations. |
update_kept | With --update, when a value stays as written because it holds a host value | Objects with step, field, variables, and env. See Values From the Host. |
| Failure field | Meaning |
|---|---|
step | The step key, for a step assertion, or the step label, for limit. |
field | status, attempts, outputs.<name>, stdout.contains, stdout.matches, stderr.contains, stderr.matches, called_with, called_with.run, called_with.run.contains, called_with.run.matches, called_with.with.<name>, called_with.env.<name>, notifications, timeout, limit, or error. |
expected | The expected value, with secrets and host values masked. For timeout, the limit in milliseconds. Absent for called_with on a step with no execution. |
actual | The actual value, with secrets and host values masked, when there is one. Absent for a called_with input or variable the call lacks. |
JUnit Report
--format junit writes exactly one JUnit XML document to stdout once every case has ended, so a CI system shows each case as a test result. For the failing test file of Reading the Report:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" failures="1" errors="0" time="0.346">
<testsuite name="workflows/release.test.yaml" tests="2" failures="1" errors="0" time="0.346">
<testcase name="deploys the built image" classname="workflows/release.test.yaml" time="0.183"></testcase>
<testcase name="a tag that is not a version skips the deploy" classname="workflows/release.test.yaml" time="0.162">
<failure message="step deploy: expected skipped, got aborted"> step deploy: expected skipped, got aborted
</failure>
</testcase>
</testsuite>
</testsuites>- Each test file is a
testsuitenamed by its path, and each case atestcasewith the file asclassname. - A failed case has a
failure, and an invalid case anerror. Itsmessageis the first line of the text report under the case, and its text is all of those lines, including the fix of an invalid case. - An invalid test file is a suite with one
testcasenamed by the file, holding the file's errors. timeis in seconds, and0.000for an invalid case.- Invalid arguments write no XML.
Exit Status
| Status | Meaning |
|---|---|
0 | Every selected case passed, or no case was selected. |
1 | At least one case failed. |
2 | At least one test file or case is invalid, or the arguments are invalid. |
The highest status that applies wins. Invalid arguments are an argument that is neither an existing path nor a DAG name in the DAGs directory, a file argument that is neither a test file nor a .yaml or .yml DAG file, a DAG file or DAG name with no test file beside it, an invalid --run expression, --format other than text, json, or junit, a --timeout that is not a positive duration, an unknown flag, and --init with other than one DAG file or with --update, --run, --keep, --format json, or --format junit. With --update, a test file edited during the run makes the command exit 1, or 2, as Updating expectations describes.

