fix: skip the core-info row when offline

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:49:31 +01:00
1 parent f195e714c4
commit 651b1404db
2 files changed
+12

No files matched your search

+3
View File
@@ -822,6 +822,9 @@ def check_coreinfo(
record_path: Path = CORE_INFO_RECORD,
) -> list[Finding]:
blobs = core_info_blobs(cache_dir, offline)
if blobs is None and offline:
# Offline with no cached listing, nothing was asked of the upstream.
return [Finding("coreinfo", "libretro-core-info", SKIPPED, detail="offline")]
if blobs is None:
return [Finding("coreinfo", "libretro-core-info", UNKNOWN, detail="listing unavailable")]
names = list(blobs)
+9
View File
@@ -310,6 +310,15 @@ class CoreResolutionTests(unittest.TestCase):
with self.assertRaises(ValueError):
cf.record_core_info({"a": "2"}, ["ghost"], record)
def test_offline_without_a_cached_listing_is_skipped(self):
"""Offline, the row read UNKNOWN and failed the run as an upstream
that could not be read, though nothing was asked of it."""
with mock.patch.object(cf, "core_info_blobs", return_value=None):
(row,) = cf.check_coreinfo(self.PROFILES, "", True)
self.assertEqual((row.status, row.detail), (cf.SKIPPED, "offline"))
(row,) = cf.check_coreinfo(self.PROFILES, "", False)
self.assertEqual(row.status, cf.UNKNOWN)
def test_the_committed_record_holds_git_blobs(self):
recorded = cf.load_core_info_record()
self.assertIsNotNone(recorded)