fix: step 5 skips a build that recorded nothing

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 19:50:46 +01:00
1 parent 9814bb1234
commit 6c92b0172e
2 files changed
+21 -2

No files matched your search

+6 -2
View File
@@ -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)),
+15
View File
@@ -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")