From 118535db246b939a999a439b138afbfd581c38a9 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 3 Nov 2026 10:17:10 +0100 Subject: [PATCH] feat: guard generated pages against retired text Retired commands, addresses and feature terms, each with its reason, and every option a generated command passes, read against its script's parser. --- tests/test_site_retired_terms.py | 157 +++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 tests/test_site_retired_terms.py diff --git a/tests/test_site_retired_terms.py b/tests/test_site_retired_terms.py new file mode 100644 index 000000000..6a93b19b9 --- /dev/null +++ b/tests/test_site_retired_terms.py @@ -0,0 +1,157 @@ +"""What the generators write must not bring back what the project retired. + +The generated pages, README.md, CONTRIBUTING.md and the site's components +are read for two things. A retired command, address or feature term, each +listed with the reason it was retired. And every `--option` a generated +command passes: the script it names must declare it in its parser, or a +reader copies a command that stops on "unrecognized arguments". + +The pages copied from wiki/ are left to their own tests: the installer page +keeps the raw one-liner as the documented fallback. +""" +from __future__ import annotations + +import ast +import re +import unittest +from functools import cache +from pathlib import Path + +from tests import sitepages + +ROOT = Path(__file__).resolve().parents[1] + +# (string, why it is retired). Compared case-sensitively against the text. +RETIRED = ( + ("raw.githubusercontent.com/Abdess/retrobios/main/install.sh", + "the site serves the one-liner at https://abdess.github.io/retrobios/i " + "since 2026-10-28, pinned to the commit the site was built from"), + ("raw.githubusercontent.com/Abdess/retrobios/main/install.ps1", + "served at https://abdess.github.io/retrobios/i.ps1 since 2026-10-28"), + ("Abdess/retroarch_system", + "the repository was renamed retrobios in March 2026"), + ("mkdocs serve", "the MkDocs site was replaced by Astro Starlight on 2026-10-22"), + ("mkdocs build", "the MkDocs site was replaced by Astro Starlight on 2026-10-22"), + ("pip install mkdocs", "the site is built by Node from website/package-lock.json"), + ('class="rb-tested', "the Tested blocks were removed on 2026-10-28: " + "only Proof lines and the Measurements page remain"), + ("rb-region-runs", "region outcomes left the system pages on 2026-10-28"), + ("## Campaign", "the campaign table left the Measurements page on 2026-10-28"), + ("| Tested by |", "the coverage table left the Measurements page on 2026-10-28"), + ("ms per frame", "benchmark figures stay in the records and SQLite files, " + "never on a page, since 2026-10-28"), + ("with this BIOS folder as", "the Tested block of platform pages, removed on 2026-10-28"), + ("regenerated in its native format", "the export patches each platform's own " + "file and never regenerates it (scripts/exporter/base_exporter.py needs_original)"), +) + +COMMAND = re.compile( + r"(?:python3? (?P