mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-05 09:33:52 -06:00
fix: compare only the full pack to verify
This commit is contained in:
1 parent
e8884e4341
commit
ce135b788f
3 files changed
+37
-10
No files matched your search
@@ -2271,9 +2271,9 @@ def _run_platform_packs(
|
|||||||
for p in group_platforms
|
for p in group_platforms
|
||||||
]
|
]
|
||||||
label = " / ".join(all_names)
|
label = " / ".join(all_names)
|
||||||
print(f"\nGenerating pack for {label} [source={source}]...")
|
print(f"\nGenerating pack for {label} [source={source}{', required' if required_only else ''}]...")
|
||||||
else:
|
else:
|
||||||
print(f"\nGenerating pack for {representative} [source={source}]...")
|
print(f"\nGenerating pack for {representative} [source={source}{', required' if required_only else ''}]...")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tc = target_cores_cache.get(representative) if args.target else None
|
tc = target_cores_cache.get(representative) if args.target else None
|
||||||
|
|||||||
+25
-8
@@ -81,11 +81,17 @@ def parse_pack_counts(output: str) -> dict[str, tuple[int, int]]:
|
|||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
m = re.match(r"Generating (?:shared )?pack for (.+)\.\.\.", line)
|
m = re.match(r"Generating (?:shared )?pack for (.+)\.\.\.", line)
|
||||||
if m:
|
if m:
|
||||||
# Labels carry execution metadata such as ``[source=full]``.
|
# Labels carry execution metadata such as ``[source=full]``. Only
|
||||||
# It is not part of the platform identity used for consistency.
|
# the full, unreduced pack is what verify describes: with
|
||||||
current_label = re.sub(
|
# --all-variants the six variants shared one label and the last
|
||||||
r"\s+\[source=[^\]]+\]$", "", m.group(1).strip()
|
# (platform, required) was compared to the full report.
|
||||||
)
|
label = m.group(1).strip()
|
||||||
|
meta = re.search(r"\s+\[([^\]]+)\]$", label)
|
||||||
|
current_label = label[: meta.start()] if meta else label
|
||||||
|
if meta and meta.group(1) != "source=full":
|
||||||
|
current_label = ""
|
||||||
|
continue
|
||||||
|
if not current_label:
|
||||||
continue
|
continue
|
||||||
if "files packed" not in line:
|
if "files packed" not in line:
|
||||||
continue
|
continue
|
||||||
@@ -557,8 +563,14 @@ def main():
|
|||||||
print("\n--- 4c/8 generate target manifests: SKIPPED (--skip-packs) ---")
|
print("\n--- 4c/8 generate target manifests: SKIPPED (--skip-packs) ---")
|
||||||
results["generate_target_manifests"] = SKIPPED
|
results["generate_target_manifests"] = SKIPPED
|
||||||
|
|
||||||
# Step 5: Consistency check
|
# Step 5: Consistency check. verify describes the full pack; a run that
|
||||||
if pack_output and verify_output:
|
# 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_output and verify_output and not full_pack_built:
|
||||||
|
print("\n--- 5/8 consistency check: SKIPPED (no full pack built) ---")
|
||||||
|
results["consistency"] = SKIPPED
|
||||||
|
elif pack_output and verify_output:
|
||||||
ok = check_consistency(verify_output, pack_output)
|
ok = check_consistency(verify_output, pack_output)
|
||||||
results["consistency"] = ok
|
results["consistency"] = ok
|
||||||
all_ok = all_ok and ok
|
all_ok = all_ok and ok
|
||||||
@@ -567,7 +579,12 @@ def main():
|
|||||||
results["consistency"] = SKIPPED
|
results["consistency"] = SKIPPED
|
||||||
|
|
||||||
# Step 6: Pack integrity (extract + hash verification)
|
# Step 6: Pack integrity (extract + hash verification)
|
||||||
if not args.skip_packs:
|
if not args.skip_packs and not full_pack_built:
|
||||||
|
# The check reads the full pack's name; a reduced pack holds fewer
|
||||||
|
# files than the platform declares by design.
|
||||||
|
print("\n--- 6/8 pack integrity: SKIPPED (no full pack built) ---")
|
||||||
|
results["pack_integrity"] = SKIPPED
|
||||||
|
elif not args.skip_packs:
|
||||||
integrity_cmd = [
|
integrity_cmd = [
|
||||||
sys.executable,
|
sys.executable,
|
||||||
"scripts/generate_pack.py",
|
"scripts/generate_pack.py",
|
||||||
|
|||||||
@@ -492,6 +492,16 @@ class PipelineRegressions(unittest.TestCase):
|
|||||||
with contextlib.redirect_stdout(io.StringIO()):
|
with contextlib.redirect_stdout(io.StringIO()):
|
||||||
self.assertFalse(pipeline.check_consistency(verify, pack))
|
self.assertFalse(pipeline.check_consistency(verify, pack))
|
||||||
|
|
||||||
|
def test_only_the_full_variant_feeds_the_comparison(self):
|
||||||
|
"""--all-variants printed six packs under one label; the last won."""
|
||||||
|
output = "\n".join([
|
||||||
|
"Generating pack for RetroArch [source=full]...",
|
||||||
|
" a.zip: 5 files packed (5 baseline + 0 from cores), 535/535 files OK",
|
||||||
|
"Generating pack for RetroArch [source=platform, required]...",
|
||||||
|
" b.zip: 5 files packed (5 baseline + 0 from cores), 530/530 files OK",
|
||||||
|
])
|
||||||
|
self.assertEqual(pipeline.parse_pack_counts(output), {"RetroArch": (535, 535)})
|
||||||
|
|
||||||
def test_slot_step_reaches_the_summary(self):
|
def test_slot_step_reaches_the_summary(self):
|
||||||
source = Path(pipeline.__file__).read_text(encoding="utf-8")
|
source = Path(pipeline.__file__).read_text(encoding="utf-8")
|
||||||
self.assertIn('results["slots"] = ok', source)
|
self.assertIn('results["slots"] = ok', source)
|
||||||
|
|||||||
Reference in new issue
Block a user