fix: raise on a registry missing a platform file

list_registered_platforms skipped a registered platform whose YAML was missing and returned an empty list without a registry. verify --all --strict, every --all build, the CI matrix and the site then ran over fewer platforms and exited 0, and install.py kept serving the stale manifest. Both now raise and name the file.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 02:22:37 +02:00
1 parent c42c756b4a
commit 9fa1f45e92
2 files changed
+29 -3

No files matched your search

+19
View File
@@ -5355,5 +5355,24 @@ class ThePackCheckAppliesTheFrontendRule(unittest.TestCase):
self.assertIsNotNone(_check_member_hash(zf, "bios/x.bin", entry, "md5"))
class ABrokenRegistryIsNotAnEmptyOne(unittest.TestCase):
"""A registered platform whose YAML was renamed was skipped without a
word, and a missing registry read as no platforms: verify --all --strict
and every --all build passed having checked nothing."""
def test_both_raise(self):
from scripts.common import list_registered_platforms
with tempfile.TemporaryDirectory(dir=TMP_ROOT) as tmp:
with self.assertRaises(FileNotFoundError):
list_registered_platforms(tmp)
Path(tmp, "_registry.yml").write_text(
"platforms:\n rocknix:\n config: rocknix.yml\n", encoding="utf-8"
)
with self.assertRaises(FileNotFoundError) as caught:
list_registered_platforms(tmp)
self.assertIn("rocknix", str(caught.exception))
if __name__ == "__main__":
unittest.main()