mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: count exclusions from the full pack only
This commit is contained in:
1 parent
9c84b7990a
commit
821cbf4717
2 files changed
+14
-4
No files matched your search
+4
-4
@@ -119,11 +119,11 @@ def parse_pack_exclusions(output: str) -> dict[str, int]:
|
||||
for line in output.splitlines():
|
||||
label_match = re.match(r"Generating (?:shared )?pack for (.+)\.\.\.", line)
|
||||
if label_match:
|
||||
current_label = re.sub(
|
||||
r"\s+\[source=[^\]]+\]$", "", label_match.group(1).strip()
|
||||
)
|
||||
# The same reading as parse_pack_counts: a reduced variant must
|
||||
# not overwrite the full pack's count under the shared label.
|
||||
current_label = _full_pack_label(label_match.group(1).strip())
|
||||
continue
|
||||
if "files packed" not in line:
|
||||
if not current_label or "files packed" not in line:
|
||||
continue
|
||||
excluded_match = re.search(r"(\d+) unsafe excluded", line)
|
||||
exclusions[current_label] = (
|
||||
|
||||
@@ -511,6 +511,16 @@ class PipelineRegressions(unittest.TestCase):
|
||||
])
|
||||
self.assertEqual(pipeline.parse_pack_counts(output), {"RetroArch": (535, 535)})
|
||||
|
||||
def test_exclusions_read_only_the_full_variant(self):
|
||||
"""--all-variants printed six packs under one label; the last won."""
|
||||
output = "\n".join([
|
||||
"Generating pack for Batocera [source=full]...",
|
||||
" a.zip: 5 files packed (5 baseline + 0 from cores), 5/5 files OK, 3 unsafe excluded",
|
||||
"Generating pack for Batocera [source=truth, required]...",
|
||||
" b.zip: 2 files packed (0 baseline + 2 from cores), 2/2 files OK",
|
||||
])
|
||||
self.assertEqual(pipeline.parse_pack_exclusions(output), {"Batocera": 3})
|
||||
|
||||
def test_slot_step_reaches_the_summary(self):
|
||||
source = Path(pipeline.__file__).read_text(encoding="utf-8")
|
||||
self.assertIn('results["slots"] = ok', source)
|
||||
|
||||
Reference in new issue
Block a user