mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: check every variant pack in step 6
This commit is contained in:
1 parent
2cb9a5a495
commit
46c651f0b0
2 files changed
+34
-16
No files matched your search
+20
-16
@@ -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:
|
||||
|
||||
@@ -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(
|
||||
[
|
||||
|
||||
Reference in new issue
Block a user