Use rk in CI
rk run-flow and rk run-suite are built for pipelines. Each run ends with an exit code for the job's result, and can write a JSON or JUnit report for the details.
A CI step
- The exit code decides the job:
0passes;1(a failed check) and3(unsupported) are test results;2,4and5mean the run itself didn't happen. -output json|junitselects the report format; text is the default. Machine reports need the licence featurereport.machine, which the community allowance includes.-output-file <path>writes the report to a file:- the file is truncated when the run starts, so an old report is never left behind;
- a human summary still goes to stdout.
Without
-output-file, a JSON or JUnit report is the only thing on stdout. Progress and logs always go to stderr.- In text mode,
-output-fileis ignored, andrkprints a note to stderr. - An unwritable
-output-fileis a usage error (exit2).
JUnit layout
A flow run is one <testsuite> with these test cases:
flow: <name>: an error if the run errored, a failure if any check failed;verdict: <name>: a failure for verdictfail, skipped forunsupported;check: <name>for each post-check, andfinal: <name>for each final check;step N: <field> <op>for each check inside the flow.
A suite run is one <testsuite> per cycle, named (cycle i/n) when there are several. It has one case per step (<step> (<flow>)), then the suite's final checks, plus a suite aborted case if the suite stopped early.
JSON
- A flow run is one object; the fields to act on are
verdict(pass,failorunsupported) andverdict_reasons. - A suite run is one object per cycle, or an array when there are several cycles; the field to act on is
outcome.
See Reports for the fields.
Read verdict, not all_passed. all_passed only means that no check failed: a run can have no failed checks and still not pass.
Check the setup before the run
rk check -c lab.yamlprobes the wire before a run:- an SCTP connect from every gNB to every AMF;
- a Diameter CER/CEA with every peer.
It exits
1if a probe fails, and doesn't probe SBI, REST, PFCP or GTP-U.rk lint -flow <file>andrk lint -suite <file> -templates <dir>check flows and suites without running them. They exit0when valid,1when not.rk validate -flow <name> -templates <dir> -c <env>checks that a flow, its bindings to the environment, and your licence fit together.