From 50790a2988b556ff5caf5af3771e5dd2c34e0867 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 20 Oct 2026 04:44:30 +0200 Subject: [PATCH] fix: the pipeline summary says what does not fail check_buildbot does not fail the run, yet the summary printed it FAILED right above Pipeline COMPLETE. It now prints WARN and a line saying the difference does not fail the run. The total is aligned under the step durations. --- scripts/pipeline.py | 14 +++++++++++++- tests/test_audit_regressions.py | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/scripts/pipeline.py b/scripts/pipeline.py index 3054b934..f4a75922 100644 --- a/scripts/pipeline.py +++ b/scripts/pipeline.py @@ -83,6 +83,10 @@ class StepResults(dict): super().__setitem__(step, outcome) + +# Steps that report without failing the run. +NON_BLOCKING = frozenset({"check_buildbot"}) + def run(cmd: list[str], label: str) -> tuple[bool, str]: """Run a command, echoing its output as it comes. Returns (success, output). @@ -784,15 +788,23 @@ def main() -> None: # Summary total_elapsed = time.monotonic() - total_start print(f"\n{'=' * 60}") + warned = [] for step, outcome in results.items(): if outcome is SKIPPED: print(f" {step:.<40} SKIPPED") continue label = "OK" if outcome else "FAILED" + if not outcome and step in NON_BLOCKING: + # Printed FAILED right above "Pipeline COMPLETE", it read as a + # contradiction: the step reports, it does not stop the run. + label = "WARN" + warned.append(step) print(f" {step:.<40} {label:<7}{results.seconds[step]:>8.1f}s") - print(f" {'total':.<40} {total_elapsed:.1f}s") + print(f" {'total':.<40} {'':<7}{total_elapsed:>8.1f}s") print(f"{'=' * 60}") print(f" Pipeline {'COMPLETE' if all_ok else 'FINISHED WITH ERRORS'}") + if warned: + print(f" {', '.join(warned)} reported a difference, which does not fail the run") print(f"{'=' * 60}") held.close() sys.exit(0 if all_ok else 1) diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 3f54e45b..341eddee 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -5526,5 +5526,32 @@ class AScraperThatCannotStartSaysWhy(unittest.TestCase): self.assertNotIn("GITHUB_TOKEN", err) +class AStepThatCannotFailTheRunIsNotShownFailed(unittest.TestCase): + """check_buildbot leaves all_ok alone, and the summary printed it FAILED + right above "Pipeline COMPLETE". The total also missed the duration + column by fourteen characters.""" + + def test_every_step_outside_all_ok_is_declared_non_blocking(self): + import pipeline + + lines = (ROOT / "scripts" / "pipeline.py").read_text(encoding="utf-8").splitlines() + loose = set() + for number, line in enumerate(lines): + found = re.search(r'results\["(\w+)"\] = ok$', line.strip()) + if not found: + continue + after = " ".join(lines[number + 1:number + 4]) + if "all_ok" not in after and "sys.exit" not in after: + loose.add(found.group(1)) + self.assertEqual(loose, set(pipeline.NON_BLOCKING)) + + def test_the_total_sits_under_the_durations(self): + step = f" {'x':.<40} {'OK':<7}{1.0:>8.1f}s" + total = f" {'total':.<40} {'':<7}{12.5:>8.1f}s" + self.assertEqual(len(step), len(total)) + self.assertIn("{'':<7}{total_elapsed:>8.1f}s", + (ROOT / "scripts" / "pipeline.py").read_text(encoding="utf-8")) + + if __name__ == "__main__": unittest.main()