From 46c651f0b024391d84a5f6bf3f94b1463f21fd81 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 03:29:12 +0100 Subject: [PATCH] fix: check every variant pack in step 6 --- scripts/pipeline.py | 36 ++++++++++++++++++--------------- tests/test_audit_regressions.py | 14 +++++++++++++ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/scripts/pipeline.py b/scripts/pipeline.py index 1ee445c71..0b020810e 100644 --- a/scripts/pipeline.py +++ b/scripts/pipeline.py @@ -790,6 +790,25 @@ class _Skipped: SKIPPED = _Skipped() +def integrity_command(args: argparse.Namespace) -> list[str]: + """Step 6: check the packs step 4 built, under the same expectation.""" + cmd = [ + sys.executable, "scripts/generate_pack.py", "--all", "--verify-packs", + "--output-dir", args.output_dir, + ] + if args.include_archived: + cmd.append("--include-archived") + # Without the target a targeted run reported every system the target + # removed as missing from a pack that was exactly right. Without + # --all-variants the five narrowed packs were never opened, and an empty + # _Platform pack passed. + if args.target: + cmd.extend(["--target", args.target]) + if args.all_variants: + cmd.append("--all-variants") + return cmd + + def _refuse_unapplied_flags( parser: argparse.ArgumentParser, args: argparse.Namespace ) -> None: @@ -1330,22 +1349,7 @@ def main() -> None: skip_notice("pack_integrity", "no full pack built") results["pack_integrity"] = SKIPPED elif not args.skip_packs: - integrity_cmd = [ - sys.executable, - "scripts/generate_pack.py", - "--all", - "--verify-packs", - "--output-dir", - args.output_dir, - ] - if args.include_archived: - integrity_cmd.append("--include-archived") - # Step 4 built with the target, so step 6 has to check against the - # same expectation. Without it a targeted run reported every system - # the target removed as missing from a pack that was exactly right. - if args.target: - integrity_cmd.extend(["--target", args.target]) - ok, _ = run(integrity_cmd, STEP_LABELS["pack_integrity"]) + ok, _ = run(integrity_command(args), STEP_LABELS["pack_integrity"]) results["pack_integrity"] = ok all_ok = all_ok and ok else: diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 600cdf19b..5d59c03e5 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -966,6 +966,20 @@ class CatalogRatioRegressions(unittest.TestCase): class PipelineRegressions(unittest.TestCase): + def test_integrity_checks_the_variants_step_4_built(self): + """Step 6 ran --verify-packs without --all-variants: the five + narrowed packs were never opened and an empty _Platform passed.""" + import argparse # noqa: PLC0415 + + def command(**flags) -> list[str]: + base = {"output_dir": "dist", "include_archived": False, + "target": None, "all_variants": False} + return pipeline.integrity_command(argparse.Namespace(**{**base, **flags})) + + self.assertIn("--all-variants", command(all_variants=True)) + self.assertNotIn("--all-variants", command()) + self.assertEqual(command(target="switch")[-2:], ["--target", "switch"]) + def test_pack_parser_removes_source_metadata(self): output = "\n".join( [