Regression-Testing a Playbook Family

REAL

The travel repo does not treat a green app build as a test of its playbooks. It runs the family through a playbook. qa/regression/suite.yaml in noetl/travel at commit cd210d7 (catalog path muno/qa/regression/suite) dispatches each case, writes one result document per case, and exits non-zero when anything is red. The suite's executor profile is local.

One process per case

The suite header says why the cases are not kind: playbook children. A runner has to run every case and report all of them. A failed step fails the run (6.5). A child that fails would abort the parent, so the first red case would hide the rest. Each case is its own noetl exec. The suite records that process's exit code. It does not let the code stop the loop.

The runner resolves noetl once (command -v noetl) and passes that path into the case. A nested dispatch then uses the binary the suite started, rather than whatever else is first on PATH inside the child.

Evidence between steps goes through files in the workspace. The prepare step deletes results/ before the run. The report is built by reading those files, so a document left behind by an earlier run would be counted again, including a pass for a case this run never started.

Four verdicts, computed, not declared

qa/regression/lib/qa_report.py at that commit computes the verdict. The case does not pass one in.

VerdictWhen verdict() returns it
passa reason was not set, at least one assertion was recorded, and every assertion has ok
failan assertion failed
blockedthe case called block, because a precondition was absent
errorthe assertion list is empty, or the harness itself broke

finish() returns process exit code 0 only for pass. blocked returns 1 as well. A case that did not run is not a pass, and a suite that counted it as green would be reporting coverage it does not have.

require_debug() exits before any case when Python's __debug__ is false. Under -O or PYTHONOPTIMIZE the interpreter strips assert statements, so a suite could report success having checked nothing. The suite invokes the reporter as env -u PYTHONOPTIMIZE python3.

Cases that can reach a live system leave the gateway URL and the server endpoint empty in the workload. Empty, those tiers call block. fail_on_blocked defaults to false, so a missing credential is reported as missing coverage and does not by itself fail the build. The README says to set it true in an environment that is supposed to have every precondition. Blocked stays not a pass either way.

This page does not quote the machine path, the test user id, or the host name baked into the case files. They are in the source. The shape does not need them.

The self-test must go red

qa/regression/selftest/vanishing-case.yaml is not a travel check. Its only step prints a line and exits 3, before it writes a result document. The suite turns a dispatch that produced no result file into error, and exits 1 when any case is error. The README's expected outcome for a run that includes this case is suite_status fail and a non-zero exit.

A runner that comes back green from that case is losing cases. Every other result it prints is then worth less than it looks.

A local run of a python playbook is not a test of it

cases/hotel-cards-smoke.yaml splits the check. Its comment says hotel-cards is kind: python, and that a local run printed "Tool not supported in local execution mode", skipped the step, and still exited 0. That sentence is the text CLI v5.3.2 prints for Tool::Unsupported, and that arm returns Ok(None), so the step does not fail the run (src/playbook_runner.rs at tag v5.3.2, the Unsupported arm). The suite does not name the CLI it observed. The words match that release.

At CLI v6.4.1 the local runtime refuses python before any step runs (8.2). The suite still does not pin a version: it uses whatever noetl is on PATH. Under either behavior, a local execution of hotel-cards is not evidence that hotel-cards ran. The tier that always runs reads the file: it parses, keeps its catalog path, still reaches a terminal step, and still declares its widget type. The live tier stays blocked until a server endpoint is set.

Not re-checked, and one question left open

The suite README tells case authors two further rules: a later step cannot read a previous step's fields, and an arc when must be a single comparison because compound booleans are mis-evaluated. CLI v5.3.2 calls render_template with context.step_results (src/playbook_runner.rs), so the first claim is not the whole story of that release. This book has not re-run either claim. The suite's practice stands without them: it passes evidence through files, and it writes the report from a shell step so the step can exit non-zero when the report is red.

The profile playbook's suggest_pois policy rule stays unverified. Section 33.2 marks it. This section does not resolve it (book#95).

The suite also refuses kind: sink for the report. Its comment says that, on the runtime they used, a sink of the step context wrote an empty file and still exited 0. Section 8.2 records that from CLI v6.4.1 the sink writes the most recently completed step's result. This book has not re-checked the suite's sink observation on that CLI. Writing the report in the shell step is what lets the suite fail on the report's contents.

What to copy

  • Run every case, then compute the verdict from the assertions. A case must not be able to declare itself green.
  • A missing precondition is blocked. Blocked is not a pass.
  • Keep a self-test that dies before it writes a verdict, and require that self-test to turn the suite red.
  • Do not treat a local run of a kind: python playbook as evidence the playbook ran. On the CLI whose message the suite quotes, that kind is skipped and the run can still exit 0. On CLI v6.4.1 it is refused before the first step.
  • Pin the CLI the suite resolved, and pass evidence through files the report actually reads.

Check your understanding