diff --git a/scripts/pipeline.py b/scripts/pipeline.py index d66e2256..46f83506 100644 --- a/scripts/pipeline.py +++ b/scripts/pipeline.py @@ -381,7 +381,7 @@ def check_consistency(verify_output: str, pack_output: str) -> bool: all_ok = False status = "OK" if all_ok else "FAILED" - print(f"--- consistency check: {status} ---") + print(f"--- {step_title(STEP_LABELS['consistency'])}, counts: {status} ---") return all_ok @@ -446,7 +446,7 @@ def check_pack_destinations( import json # noqa: PLC0415 import zipfile # noqa: PLC0415 - print("\n--- 5/8 consistency check: destinations ---") + print(f"\n--- {step_title(STEP_LABELS['consistency'])}, destinations ---") try: credited_by = json.loads(Path(destinations_file).read_text()) except (OSError, ValueError) as exc: @@ -505,7 +505,7 @@ def check_emulator_packs( select_emulator_profiles, ) - print("\n--- 5/8 consistency check: emulator packs ---") + print(f"\n--- {step_title(STEP_LABELS['consistency'])}, emulator packs ---") db = load_database(db_path) zip_contents = build_zip_contents_index(db) profiles = load_emulator_profiles(emulators_dir, skip_aliases=False) @@ -1008,7 +1008,10 @@ def main() -> None: # Counts can agree while the paths differ, both ways at once. ok = check_pack_destinations(destinations_file, pack_output) and ok ok = check_emulator_packs() and ok - print(f"--- 5/8 consistency check, counts and paths: {'OK' if ok else 'FAILED'} ---") + print( + f"--- {step_title(STEP_LABELS['consistency'])}, counts and paths: " + f"{'OK' if ok else 'FAILED'} ---" + ) results["consistency"] = ok all_ok = all_ok and ok else: diff --git a/tests/test_tool_messages.py b/tests/test_tool_messages.py index 75467364..abda8a50 100644 --- a/tests/test_tool_messages.py +++ b/tests/test_tool_messages.py @@ -167,6 +167,14 @@ class ThePipelineCountsItsRealSteps(unittest.TestCase): # A step's own label, or a second command of a listed step. self.assertIn(label.split(" ", 1)[0], numbers) + def test_no_title_counts_eight_steps(self): + """Three print() headers of step 5 still read "5/8" beside the + computed "5 consistency check [20/24]".""" + import re # noqa: PLC0415 + + source = (REPO_ROOT / "scripts" / "pipeline.py").read_text(encoding="utf-8") + self.assertEqual(re.findall(r'"[^"\n]*---[^"\n]*\b\d+[a-z]?/\d+\b[^"\n]*"', source), []) + def test_progress_comes_from_the_list(self): total = len(pipeline.STEP_LABELS) title = pipeline.step_title(pipeline.STEP_LABELS["render_site"])