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.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 04:44:30 +02:00
1 parent eaa40d7384
commit 50790a2988
2 files changed
+40 -1

No files matched your search

+13 -1
View File
@@ -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)