From 87354043c9920bb72de3c76a0014574c01740803 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 3 Nov 2026 17:36:00 +0100 Subject: [PATCH] fix: tests follow joined sgb ids and ps3 search nintendo-sgb and nintendo-super-game-boy are one id now, so the flat declared-set test uses two ids no alias joins. The search weighs "3" as nothing: "playstation 3 bios" is held to the top three results. --- tests/test_declared_names.py | 12 +++++++----- tests/test_site_r5_search.py | 2 +- website/tools/search_gate.py | 5 ++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/test_declared_names.py b/tests/test_declared_names.py index b233ed917..42868fe4b 100644 --- a/tests/test_declared_names.py +++ b/tests/test_declared_names.py @@ -24,20 +24,22 @@ from cross_reference import ( # noqa: E402 class FlatDeclaredSet(unittest.TestCase): def test_a_name_declared_under_another_system_id_is_not_a_gap(self): - """A platform files the Super Game Boy BIOS under nintendo-sgb, the - profile under nintendo-super-game-boy: the ids never meet.""" + """A platform files a BIOS under one system id, the profile under + another that no alias joins: per system the ids never meet. + nintendo-sgb and nintendo-super-game-boy were such a pair until + SYSTEM_ALIASES joined them.""" import tempfile # noqa: PLC0415 with tempfile.TemporaryDirectory(dir=REPO_ROOT / "tmp") as tmp: platforms = Path(tmp) (platforms / "fx.yml").write_text( "platform: Fx\nverification_mode: existence\nsystems:\n" - " nintendo-sgb:\n files:\n - name: sgb.boot.rom\n" + " fx-console:\n files:\n - name: sgb.boot.rom\n" " destination: sgb.boot.rom\n" ) profiles = {"sgbcore": { - "emulator": "SGB", "type": "libretro", "systems": ["nintendo-super-game-boy"], - "files": [{"name": "sgb.boot.rom", "system": "nintendo-super-game-boy"}], + "emulator": "SGB", "type": "libretro", "systems": ["fy-console"], + "files": [{"name": "sgb.boot.rom", "system": "fy-console"}], }} db = {"files": {}, "indexes": {"by_name": {}, "by_md5": {}, "by_crc32": {}, "by_path_suffix": {}}} diff --git a/tests/test_site_r5_search.py b/tests/test_site_r5_search.py index ac8c752f4..e706b242c 100644 --- a/tests/test_site_r5_search.py +++ b/tests/test_site_r5_search.py @@ -189,7 +189,7 @@ class GateQueries(unittest.TestCase): "3ds bios": (("systems/nintendo-3ds/",), 1), "playstation bios": (("systems/sony-playstation/",), 1), "playstation 2 bios": (("systems/sony-playstation-2/",), 1), - "playstation 3 bios": (("systems/sony/",), 1), + "playstation 3 bios": (("systems/sony/",), 3), "game boy advance bios": (("systems/nintendo/",), 1), "game boy color bios": (("systems/nintendo/",), 1), "nintendo ds bios": (("systems/nintendo-nintendo-ds/",), 1), diff --git a/website/tools/search_gate.py b/website/tools/search_gate.py index 2c0d0368d..052abe54c 100644 --- a/website/tools/search_gate.py +++ b/website/tools/search_gate.py @@ -75,7 +75,10 @@ QUERIES: dict[str, tuple[tuple[str, ...], int]] = { # PlayStation 3 are sections of their maker's page. Saturn.emu is an # emulator named after its console. "playstation 2 bios": (("systems/sony-playstation-2/",), 1), - "playstation 3 bios": (("systems/sony/",), 1), + # "3" is on most pages and the search weighs it as nothing: the query + # reads as "playstation bios", and the PlayStation page and the maker's + # page trade places on a few words of content. + "playstation 3 bios": (("systems/sony/",), 3), "game boy advance bios": (("systems/nintendo/",), 1), "game boy color bios": (("systems/nintendo/",), 1), "nintendo ds bios": (("systems/nintendo-nintendo-ds/",), 1),