fix: regenerate the truth before a native refresh

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 14:34:42 +02:00
1 parent 090369cb20
commit 3c5570f8f0
5 files changed
+33 -10

No files matched your search

+5 -2
View File
@@ -265,8 +265,11 @@ class StaleTruth(ValueError):
@functools.lru_cache(maxsize=None)
def _truth_sources(platforms_dir: str) -> tuple[dict, dict, dict | None]:
"""Registry, profiles and database, as generate_truth reads them."""
with open(Path(platforms_dir) / "_registry.yml") as handle:
registry = (yaml_load(handle) or {}).get("platforms", {})
registry_path = Path(platforms_dir) / "_registry.yml"
registry: dict = {}
if registry_path.exists():
with open(registry_path) as handle:
registry = (yaml_load(handle) or {}).get("platforms", {})
profiles = load_emulator_profiles("emulators")
db = load_database(TRUTH_DB) if Path(TRUTH_DB).exists() else None
return registry, profiles, db