fix: group regions by the target in pack integrity

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 00:13:38 +02:00
1 parent 64f84e7ca6
commit c4a080b0f4
2 files changed
+28

No files matched your search

+1
View File
@@ -514,6 +514,7 @@ def verify_pack_against_platform(
db,
base_dest,
emu_profiles,
target_cores=target_cores,
)
region_drops = region_mod.resolve_region_drops(
region_groups, region_index, regions
+27
View File
@@ -584,6 +584,33 @@ class TestReportAndBuilderNarrowTogether(unittest.TestCase):
self.assertIn(kept, names, "a system with no candidate in the region falls back")
self.assertEqual(full["total_files"], narrowed["total_files"])
def test_every_grouping_call_carries_the_target(self):
"""Integrity grouped every core's extras while the builder grouped the target's.
Under --target with --region, a fallback the pack kept was withdrawn
from the check: 14 Batocera rk3568 files were never verified.
"""
import ast
scripts = Path(__file__).resolve().parent.parent / "scripts"
for path in sorted(scripts.rglob("*.py")):
tree = ast.parse(path.read_text(encoding="utf-8"))
for func in ast.walk(tree):
if not isinstance(func, (ast.FunctionDef, ast.AsyncFunctionDef)):
continue
params = {a.arg for a in func.args.args + func.args.kwonlyargs}
if "target_cores" not in params:
continue
for call in ast.walk(func):
if (
isinstance(call, ast.Call)
and getattr(call.func, "id", None) == "platform_region_groups"
):
with self.subTest(module=path.name, function=func.name):
self.assertIn(
"target_cores", {k.arg for k in call.keywords}
)
if __name__ == "__main__":
unittest.main()