From 6c92b0172ead2736d415cf6201f254adfd1c3ce4 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 21 Nov 2026 19:46:53 +0100 Subject: [PATCH] fix: step 5 skips a build that recorded nothing --- scripts/orchestrate/checks.py | 8 ++++++-- tests/test_audit_regressions.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/orchestrate/checks.py b/scripts/orchestrate/checks.py index 5b18348e3..9457d2fe8 100644 --- a/scripts/orchestrate/checks.py +++ b/scripts/orchestrate/checks.py @@ -4,6 +4,7 @@ from __future__ import annotations import argparse import sys +from pathlib import Path from core.paths import PLATFORMS_DIR from model.registry import list_release_pack_platforms @@ -46,10 +47,13 @@ def check_steps( # built only a reduced one (--source platform or truth) has nothing to # compare it with, and says so instead of failing on an empty parse. full_pack_built = args.source == "full" or args.all_variants - if pack_counts_file and not full_pack_built: + # A build that wrote no record (skipped, or stopped before its counts) + # has nothing to compare: step 4 already reports its own failure. + packs_recorded = bool(pack_counts_file) and Path(pack_counts_file).stat().st_size > 0 + if packs_recorded and not full_pack_built: skip_notice("consistency", "no full pack built") results["consistency"] = SKIPPED - elif pack_counts_file: + elif packs_recorded: ok = check_consistency( destinations_file, pack_counts_file, set(list_release_pack_platforms(PLATFORMS_DIR)), diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 9145c496e..598819410 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -1276,6 +1276,21 @@ class PipelineRegressions(unittest.TestCase): self.assertFalse(consistency.compare_counts(verify, packs)) self.assertIn("Batocera: pack with no verify result", out.getvalue()) + def test_a_build_that_recorded_nothing_skips_step_five(self): + """An empty counts file is a build that stopped before its record: + step 4 already fails, and step 5 has nothing to compare.""" + import argparse + + args = argparse.Namespace(source="full", all_variants=False, skip_packs=True) + with tempfile.TemporaryDirectory() as root: + empty = os.path.join(root, "counts.json") + Path(empty).write_text("") + step_results: dict = {} + with contextlib.redirect_stdout(io.StringIO()): + checks.check_steps(args, step_results, pack_counts_file=empty, + destinations_file=empty) + self.assertIs(step_results["consistency"], results.SKIPPED) + def test_only_the_full_variant_is_recorded(self): """--all-variants built six packs under one label, and the last won.""" source = script_source("generate_pack.py")