chore: merge origin/main

This commit is contained in:
Abdessamad Derraz committed 2026-11-09 10:57:37 +01:00
commit 7d23d8f40b
49 files changed
+501 -117

No files matched your search

+1 -1
View File
@@ -370,7 +370,7 @@
=== plan-in-place
^[[0;1m ^[[0;1;35mRetroBIOS^[[0;1m: RetroArch^[[0m
^[[0;1m ^[[0;1;32mEverything is in place^[[0m
^[[0;1m ^[[0;1;32mEvery file on the list is in place^[[0m
BIOS folder: ^[[0;1m~/.config/retroarch/system^[[0m
^[[0;32m5 in place^[[0m, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+1 -1
View File
@@ -118,7 +118,7 @@
=== plan-in-place
^[[0;1m ^[[0;1;35mRetroBIOS^[[0;1m: RetroArch^[[0m
^[[0;1m ^[[0;1;32mEverything is in place^[[0m
^[[0;1m ^[[0;1;32mEvery file on the list is in place^[[0m
BIOS folder:
^[[0;1m~/.config/retroarch/system^[[0m
^[[0;32m5 in place^[[0m, 0 missing, 0 wrong copies
+1 -1
View File
@@ -145,7 +145,7 @@
=== plan-in-place
^[[0;1m ^[[0;1;35mRetroBIOS^[[0;1m: RetroArch^[[0m
^[[0;1m ^[[0;1;32mEverything is in place^[[0m
^[[0;1m ^[[0;1;32mEvery file on the list is in place^[[0m
BIOS folder:
^[[0;1m~/.config/retroarch/system^[[0m
^[[0;32m5 in place^[[0m, 0 missing, 0 wrong copies
+1 -1
View File
@@ -226,7 +226,7 @@
=== plan-in-place
^[[0;1m ^[[0;1;35mRetroBIOS^[[0;1m: RetroArch^[[0m
^[[0;1m ^[[0;1;32mEverything is in place^[[0m
^[[0;1m ^[[0;1;32mEvery file on the list is in place^[[0m
BIOS folder: ^[[0;1m~/.config/retroarch/system^[[0m
^[[0;32m5 in place^[[0m, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+1 -1
View File
@@ -1,6 +1,6 @@
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+1 -1
View File
@@ -1,6 +1,6 @@
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
+1 -1
View File
@@ -1,6 +1,6 @@
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
+1 -1
View File
@@ -1,6 +1,6 @@
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+3 -3
View File
@@ -458,7 +458,7 @@
=== plan-in-place 40x12
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -471,7 +471,7 @@
=== plan-in-place 40x15
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -487,7 +487,7 @@
=== plan-in-place 80x24
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+3 -3
View File
@@ -458,7 +458,7 @@
=== plan-in-place 40x12
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -471,7 +471,7 @@
=== plan-in-place 40x15
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -487,7 +487,7 @@
=== plan-in-place 80x24
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+3 -3
View File
@@ -458,7 +458,7 @@
=== plan-in-place 40x12
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -471,7 +471,7 @@
=== plan-in-place 40x15
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -487,7 +487,7 @@
=== plan-in-place 80x24
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+3 -3
View File
@@ -433,7 +433,7 @@
=== plan-in-place 40x12
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -446,7 +446,7 @@
=== plan-in-place 40x15
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -462,7 +462,7 @@
=== plan-in-place 80x24
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+3 -3
View File
@@ -487,7 +487,7 @@
=== plan-in-place 40x12
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -500,7 +500,7 @@
=== plan-in-place 40x15
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -516,7 +516,7 @@
=== plan-in-place 80x24
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+3 -3
View File
@@ -487,7 +487,7 @@
=== plan-in-place 40x12
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -500,7 +500,7 @@
=== plan-in-place 40x15
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder:
~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
@@ -516,7 +516,7 @@
=== plan-in-place 80x24
RetroBIOS: RetroArch
Everything is in place
Every file on the list is in place
BIOS folder: ~/.config/retroarch/system
5 in place, 0 missing, 0 wrong copies
1 of the 0 wrong copies is replaced, the old one kept in a backup folder.
+1 -1
View File
@@ -1665,7 +1665,7 @@ class InstallerPagesFollowTheCode(unittest.TestCase):
def test_a_message_the_installer_does_not_print_fails(self):
corpus = _literals()
self.assertEqual(unprinted_messages("It ends `Everything is in place.` here.\n", corpus), [])
self.assertEqual(unprinted_messages("It ends `Every file on the list is in place.` here.\n", corpus), [])
self.assertEqual(len(unprinted_messages("It says `All BIOS files are present.`\n", corpus)), 1)
self.assertEqual(unprinted_messages(
"`E:\\ holds 38 of these files: a run without --check copies them.`\n", corpus), [])
+2 -2
View File
@@ -5674,7 +5674,7 @@ class RunsAgainstTheRealLists(unittest.TestCase, _LoopbackRun):
proc = _install_run(self.env, "--platform", "retroarch", "--dest", str(dest),
"--system", "sony-psp", "--check", "--no-input")
self.assertEqual(proc.returncode, 3, proc.stdout + proc.stderr)
self.assertNotIn("Everything is in place", proc.stdout)
self.assertNotIn("Every file on the list is in place", proc.stdout)
found = re.search(r"(\d+) in place, (\d+) missing", proc.stdout)
self.assertIsNotNone(found, proc.stdout)
self.assertIn(f"\n {found.group(2)} data files to fetch\n", proc.stdout)
@@ -5949,7 +5949,7 @@ class StandaloneEmulatorsWithoutAPlatformAreServed(unittest.TestCase, _LoopbackR
if name not in named and not name.startswith("scph")], [])
proc = _install_run(self.env, "--no-input", "--check")
self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr)
self.assertIn("Everything is in place.", proc.stdout)
self.assertIn("Every file on the list is in place.", proc.stdout)
def test_no_emulator_folder_keeps_the_hint(self):
self.duckstation.rmdir()
+2 -2
View File
@@ -13230,7 +13230,7 @@ class OneVocabularyOneCount(unittest.TestCase):
with self.subTest(**given):
text = self.run_line(listing, dest, [""], offline=True, **given)
self.assertIn("2 in place, 0 missing, 0 wrong copies", text)
self.assertIn("Everything is in place", text)
self.assertIn("Every file on the list is in place", text)
self.assertNotIn("up to date", text)
self.assertNotIn("0 files installed", text)
state = checked_state()
@@ -13239,7 +13239,7 @@ class OneVocabularyOneCount(unittest.TestCase):
"failed": []}
state.code = 0
_title, lines = install.tui_outcome(state)
self.assertEqual(lines[0], "Everything is in place.")
self.assertEqual(lines[0], "Every file on the list is in place.")
def test_check_names_a_wrong_copy_as_such(self):
listing, dest, _old = self.two_files()
+11 -3
View File
@@ -324,9 +324,17 @@ class TitleLogoOnAPlate(unittest.TestCase):
self.assertIn('height="40"', image)
def test_a_setup_with_no_logo_gets_its_initials(self):
# Every setup has a logo today: the fallback is read where it is
# written, the tile's and the title's.
import sitemarkup # noqa: PLC0415
self.assertRegex(sitemarkup._tile_mark("MyMinUI", ""), r"<svg[^>]*>.*>MM</text></svg>")
component = _read(REPO_ROOT / "website" / "src" / "components" / "PageTitle.astro")
self.assertIn("{initials(setup.name)}", component)
def test_myminui_shows_its_logo(self):
block = _title_through_heading(_built("platforms/myminui"))
self.assertNotIn("<img", block)
self.assertRegex(block, r"<svg class=\"rb-title-mark[^>]*>.*?>MM</text>")
self.assertIn('src="/retrobios/assets/logos/myminui.webp"', block)
class NoLevelBadgeOnATabRoot(unittest.TestCase):
@@ -616,7 +624,7 @@ class LogosAtTheirDisplaySize(unittest.TestCase):
self.assertEqual(sorted(p.name for p in LOGOS.glob("*.png")), [])
script = _read(REPO_ROOT / "scripts" / "fetch_site_images.py")
self.assertIn(f"LOGO_SIZE = {LOGO_PIXELS}", script)
self.assertIn('square_image(data, LOGO_SIZE, "WEBP")', script)
self.assertIn('square_image(\n data, LOGO_SIZE, "WEBP"', script)
def test_pages_point_at_the_copies(self):
html = _built("platforms/emudeck")
+1 -1
View File
@@ -607,7 +607,7 @@ class YourSetupIndexInPlainWords(unittest.TestCase):
class HomeCopy(unittest.TestCase):
def test_dreamcast_and_the_check_link(self):
home = re.sub(r"</?abbr[^>]*>", "", _page("index.md"))
self.assertIn("- **Yes** for PlayStation 1 and 2, Saturn and Neo Geo.", home)
self.assertIn("- **Yes** for PlayStation 2 and Neo Geo.", home)
self.assertIn("- **Better with it** for Dreamcast: some games need it.", home)
# A question and the link that answers it: no level label, which
# read as a broken crumb beside the Reference tab.
+108
View File
@@ -0,0 +1,108 @@
"""A copy an assistant read long ago can be told from the current one.
Each Markdown copy, llms.txt and llms-full.txt name the commit they were
built from, version.json names the current one, and the next deploy lists
the pages whose words changed for IndexNow."""
from __future__ import annotations
import json
import sys
import tempfile
import unittest
from pathlib import Path
import tests # noqa: F401
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT / "scripts"))
import indexnow # noqa: E402
import siteagents # noqa: E402
import site_markdown # noqa: E402
STAMP = {"commit": "0123456789abcdef0123456789abcdef01234567", "date": "2026-11-09T08:00:00+01:00"}
# The two parts a built Starlight page gives the copy: its title and its content.
PAGE = ('<html><body><h1 id="_top">Title</h1>'
'<div class="sl-markdown-content"><p>Words of the page.</p></div></body></html>')
def _site(root: Path, words: str = "Words of the page.") -> Path:
dist = root / "dist"
for page in ("", "wiki/faq/"):
(dist / page).mkdir(parents=True, exist_ok=True)
(dist / page / "index.html").write_text(PAGE.replace("Words of the page.", words),
encoding="utf-8")
(dist / "llms.txt").write_text("# RetroBIOS\n\n> The summary.\n\n## Start\n", encoding="utf-8")
return dist
class BuildStamp(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.TemporaryDirectory(dir=ROOT / "tmp")
self.dist = _site(Path(self.tmp.name))
site_markdown.convert_site(self.dist, STAMP)
def tearDown(self):
self.tmp.cleanup()
def test_each_copy_names_its_commit_under_its_title(self):
lines = (self.dist / "wiki" / "faq" / "index.md").read_text(encoding="utf-8").splitlines()
self.assertTrue(lines[0].startswith("# "))
self.assertEqual(lines[2], "> Built from commit 0123456789ab on 2026-11-09. "
"The current build: https://abdess.github.io/retrobios/version.json")
def test_version_json_names_the_build(self):
self.assertEqual(json.loads((self.dist / "version.json").read_text(encoding="utf-8")), STAMP)
def test_llms_txt_keeps_its_summary_after_the_title(self):
text = (self.dist / "llms.txt").read_text(encoding="utf-8")
self.assertTrue(text.startswith("# RetroBIOS\n\n> The summary.\n\nBuilt from commit 0123456789ab"))
def test_llms_full_says_the_build_once(self):
text = (self.dist / "llms-full.txt").read_text(encoding="utf-8")
self.assertEqual(text.count("Built from commit"), 1)
def test_digests_ignore_the_build_line(self):
first = json.loads((self.dist / "digests.json").read_text(encoding="utf-8"))
with tempfile.TemporaryDirectory(dir=ROOT / "tmp") as other:
dist = _site(Path(other))
site_markdown.convert_site(dist, {"commit": "f" * 40, "date": "2026-11-10T00:00:00Z"})
second = json.loads((dist / "digests.json").read_text(encoding="utf-8"))
self.assertEqual(first, second)
self.assertIn("https://abdess.github.io/retrobios/llms.txt", first)
class IndexNowList(unittest.TestCase):
def test_added_changed_and_removed_pages_are_listed(self):
old = {"a": "1", "b": "2", "gone": "3"}
new = {"a": "1", "b": "9", "new": "4"}
self.assertEqual(indexnow.changed_urls(new, old), ["b", "gone", "new"])
def test_the_first_deploy_lists_every_page(self):
self.assertEqual(indexnow.changed_urls({"a": "1", "b": "2"}, {}), ["a", "b"])
def test_the_key_is_served_where_the_request_says(self):
body = indexnow.payload(["https://abdess.github.io/retrobios/"])
self.assertEqual(body["keyLocation"], "https://abdess.github.io/retrobios/indexnow.txt")
with tempfile.TemporaryDirectory(dir=ROOT / "tmp") as public:
written: dict[str, str] = {}
siteagents.write(Path(public), [], lambda path, text: written.__setitem__(path, text))
self.assertEqual(written[str(Path(public) / "indexnow.txt")].strip(), body["key"])
def test_the_deploy_posts_the_list_after_the_site_is_live(self):
workflow = (ROOT / ".github" / "workflows" / "deploy-site.yml").read_text(encoding="utf-8")
listed = workflow.index("scripts/indexnow.py --dist website/dist")
deployed = workflow.index("actions/deploy-pages@")
posted = workflow.index("https://api.indexnow.org/indexnow")
self.assertLess(listed, deployed)
self.assertLess(deployed, posted)
class AnswerRule(unittest.TestCase):
def test_assistants_are_told_to_compare_the_commit(self):
self.assertTrue(any("version.json" in rule for rule in siteagents.ANSWER_RULES))
if __name__ == "__main__":
unittest.main()
+12 -5
View File
@@ -82,15 +82,22 @@ class PlatformLogos(unittest.TestCase):
self.assertTrue(self.registry["bizhawk"]["logo"].endswith(
"/src/BizHawk.Client.EmuHawk/images/logo.ico"))
def test_minui_has_no_logo_and_no_stale_copy(self):
self.assertNotIn("logo", self.registry["minui"])
self.assertEqual(list((REPO_ROOT / "docs_assets" / "logos").glob("minui.*")), [])
def test_minui_shows_its_boot_logo_not_its_author(self):
# The author's GitHub avatar is a face, not the project's mark.
self.assertIn("/Bootlogo.pak/", self.registry["minui"]["logo"])
self.assertTrue(self.registry["minui"]["logo_flip"])
def test_every_logo_copy_has_a_registry_logo(self):
def test_every_logo_copy_has_a_registry_or_tile_logo(self):
from siteguides import GROUP_TILES # noqa: PLC0415
tiles = {re.sub(r"[^a-z0-9]+", "-", tile.name.lower()).strip("-"): tile.logo
for group in GROUP_TILES.values() for tile in group}
sources = json.loads((REPO_ROOT / "docs_assets" / "logos" / "sources.json").read_text())
for entry in sources["images"]:
with self.subTest(platform=entry["platform"]):
self.assertEqual(self.registry[entry["platform"]].get("logo"), entry["source"])
logo = (self.registry[entry["platform"]].get("logo")
if entry["platform"] in self.registry else tiles.get(entry["platform"]))
self.assertEqual(logo, entry["source"])
class NodeCompileCache(unittest.TestCase):