diff --git a/scripts/check_freshness.py b/scripts/check_freshness.py index a1116142d..a91875ab4 100644 --- a/scripts/check_freshness.py +++ b/scripts/check_freshness.py @@ -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) diff --git a/tests/test_check_freshness.py b/tests/test_check_freshness.py index 05b6cc70b..33871a167 100644 --- a/tests/test_check_freshness.py +++ b/tests/test_check_freshness.py @@ -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)