From b566a95c3fc591b3ec0dd33a8bd78abbbce654a8 Mon Sep 17 00:00:00 2001 From: Brett Heap Date: Sun, 18 Oct 2026 10:03:41 +0000 Subject: [PATCH 1/2] test_repo_hygiene.py: the one-line install is held in every release's notes under `docs/release-notes/`, found when the tests are collected, except v1.0.0's, which predates the line, so a mistyped copy in v1.1.0.md fails and a new release's notes are held with no edit to the test (#885) `ONE_LINE_INSTALL_IN` named `docs/release-notes/v1.0.1.md` alone, so the copy in v1.1.0.md, and the one #883 adds in v1.1.1.md, were not held. The notes are now globbed (`*.md`), less `RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL = {"v1.0.0.md"}`, the one notes file with no copy of the line; a `.md` there that is not a release's notes fails until it is named in that set. A second test holds that v1.0.1.md and v1.1.0.md were found, so a moved directory or a pattern that matches nothing cannot pass by holding nothing. Mutant proof: `install.sh | bash` changed to `install.sh | bsh` on line 49 of docs/release-notes/v1.1.0.md fails `test_the_one_line_install_is_the_same_everywhere[docs/release-notes/v1.1.0.md]` here (1 failed, 7 passed), and passes on the unchanged test (6 passed). tests/test_repo_hygiene.py, tests/test_release_workflow.py and tests/test_workflow_concurrency.py: 150 passed. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 --- tests/test_repo_hygiene.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/test_repo_hygiene.py b/tests/test_repo_hygiene.py index 00fc68b9..8220dbe6 100644 --- a/tests/test_repo_hygiene.py +++ b/tests/test_repo_hygiene.py @@ -1556,15 +1556,26 @@ def test_the_openrepotools_install_line_is_the_same_everywhere(name): #: THE ONE LINE THAT INSTALLS THIS STANDARD (#564), and every file that #: carries it: the installer it fetches, the command it installs (in its -#: header), the README and its designed reading, and the release notes that -#: introduced it. Pasted by people who cannot check it, like the two lines -#: above, so the copies are held byte for byte. `releases/latest/download/` -#: is what makes it the NEWEST release's `install.sh` every time. +#: header), the README and its designed reading, and the notes of every +#: release since v1.0.1, which introduced it. Pasted by people who cannot +#: check it, like the two lines above, so the copies are held byte for byte. +#: `releases/latest/download/` is what makes it the NEWEST release's +#: `install.sh` every time. ONE_LINE_INSTALL = ( "curl -fsSL https://github.com/opensoft/openRepoShape/releases/latest/" "download/install.sh | bash") -ONE_LINE_INSTALL_IN = ["install.sh", "openRepoShape", "README.md", - "docs/handbook.html", "docs/release-notes/v1.0.1.md"] +#: The notes are read from `docs/release-notes/` when the tests are collected, +#: not named, so a release's notes are held the day they are added, with no +#: edit here (#885: the list named v1.0.1.md alone, so a mistyped line in +#: v1.1.0.md passed). The set is the notes that predate the line: v1.0.0's +#: carries none. A `.md` in that directory that is not a release's notes +#: fails with them until it is named here. +RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL = {"v1.0.0.md"} +ONE_LINE_INSTALL_IN = [ + "install.sh", "openRepoShape", "README.md", "docs/handbook.html", + *(path.relative_to(REPO).as_posix() + for path in sorted((REPO / "docs" / "release-notes").glob("*.md")) + if path.name not in RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL)] @pytest.mark.parametrize("name", ONE_LINE_INSTALL_IN) @@ -1575,6 +1586,13 @@ def test_the_one_line_install_is_the_same_everywhere(name): f" {ONE_LINE_INSTALL}") +def test_the_one_line_install_holds_the_release_notes_it_found(): + """The notes are found, not named, so a directory that moved or a pattern + that stopped matching would hold none of them and pass (#885).""" + assert {"docs/release-notes/v1.0.1.md", + "docs/release-notes/v1.1.0.md"} <= set(ONE_LINE_INSTALL_IN) + + def test_every_handbook_copy_of_the_one_line_install_is_the_same(): """The handbook shows the one line in three code blocks: the masthead's, step 3's on the Linux, macOS and WSL2 tabs, and step 3's on the Windows From 96422b98320687d96e9c27ade8d6586485089e65 Mon Sep 17 00:00:00 2001 From: Brett Heap Date: Sun, 18 Oct 2026 14:35:37 +0000 Subject: [PATCH 2/2] test_repo_hygiene.py and test_release_workflow.py: a `.md` under `docs/release-notes/` that carries no install line is told to be named in `RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL` as well as to carry the line, a release's `v*.md` named in that set fails, and the header test's docstring no longer says v1.1.0.md does not exist (#885) Lane 5's review of #887 (READY, no MUST): - SHOULD 1: the failure for a path under `docs/release-notes/` now ends `, or, if it is not a release's notes, name 'README.md' in RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL`. Mutant M8, a scratch `docs/release-notes/README.md`, shows it; naming `README.md` in the set passes. - NIT 2 (M6): the second test now holds every `docs/release-notes/v*.md` but v1.0.0.md, spelled out there and not read from the set, and keeps the v1.0.1.md and v1.1.0.md anchor. `v1.1.1.md` added to the set fails it. - test_release_workflow.py: the docstring said no v1.1.0.md existed yet; v1.1.0.md and v1.1.1.md both point at the header, and say so now. - NIT 1 (M7, M10) is not taken: the handbook test's selector (a line holding `download/install.sh`) takes ten lines from the notes, three the exact line, one a pinned `| bash -s -- v1.0.1` (v1.0.1.md:45) and six bare URL lines in a verify command, so every-copy would need a new rule on which variants are allowed. Mutants M1, M5, M6, M8 caught on this tree; the three test files: 151 passed. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 --- tests/test_release_workflow.py | 8 ++++---- tests/test_repo_hygiene.py | 29 +++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/tests/test_release_workflow.py b/tests/test_release_workflow.py index 99fb2909..4ae93519 100644 --- a/tests/test_release_workflow.py +++ b/tests/test_release_workflow.py @@ -577,10 +577,10 @@ def test_the_install_check_runs_on_three_systems_and_python_3_9(workflow): def test_the_header_says_how_to_release(workflow): - """No `docs/release-notes/v1.1.0.md` exists yet, so the header carries - the steps the docs pull request will point at: Brett Heap's acts, with - the trusted publisher's environment REQUIRED and why (RV599, SHOULD 1), - and the limits carried over from openDox-code.""" + """The release notes (`docs/release-notes/v1.1.0.md` and `v1.1.1.md`) + point at this header for the steps, so it carries them: Brett Heap's + acts, with the trusted publisher's environment REQUIRED and why (RV599, + SHOULD 1), and the limits carried over from openDox-code.""" text = WORKFLOW.read_text(encoding="utf-8") assert "# RELEASING TO PyPI." in text assert "gh workflow run release.yml --ref v -f version=" \ diff --git a/tests/test_repo_hygiene.py b/tests/test_repo_hygiene.py index 8220dbe6..844246c2 100644 --- a/tests/test_repo_hygiene.py +++ b/tests/test_repo_hygiene.py @@ -1569,28 +1569,45 @@ def test_the_openrepotools_install_line_is_the_same_everywhere(name): #: edit here (#885: the list named v1.0.1.md alone, so a mistyped line in #: v1.1.0.md passed). The set is the notes that predate the line: v1.0.0's #: carries none. A `.md` in that directory that is not a release's notes -#: fails with them until it is named here. +#: fails with them until it is named here; a `v*.md` named here fails the +#: second test below. +RELEASE_NOTES = REPO / "docs" / "release-notes" RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL = {"v1.0.0.md"} ONE_LINE_INSTALL_IN = [ "install.sh", "openRepoShape", "README.md", "docs/handbook.html", *(path.relative_to(REPO).as_posix() - for path in sorted((REPO / "docs" / "release-notes").glob("*.md")) + for path in sorted(RELEASE_NOTES.glob("*.md")) if path.name not in RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL)] @pytest.mark.parametrize("name", ONE_LINE_INSTALL_IN) def test_the_one_line_install_is_the_same_everywhere(name): - text = (REPO / name).read_text(encoding="utf-8") + path = REPO / name + text = path.read_text(encoding="utf-8") + other = "" + if path.parent == RELEASE_NOTES: + other = (f", or, if it is not a release's notes, name {path.name!r} " + "in RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL") assert ONE_LINE_INSTALL in text, ( - f"{name} must carry the one-line install byte for byte:\n" + f"{name} must carry the one-line install byte for byte{other}:\n" f" {ONE_LINE_INSTALL}") def test_the_one_line_install_holds_the_release_notes_it_found(): """The notes are found, not named, so a directory that moved or a pattern - that stopped matching would hold none of them and pass (#885).""" + that stopped matching would hold none of them and pass; and the set is + for what is not a release's notes, so it may not name one: every `v*.md` + but v1.0.0.md, which predates the line, is held (#885). That one is + spelled out here, not read from the set this test holds to account.""" + notes = {path.relative_to(REPO).as_posix() + for path in RELEASE_NOTES.glob("v*.md") + if path.name != "v1.0.0.md"} assert {"docs/release-notes/v1.0.1.md", - "docs/release-notes/v1.1.0.md"} <= set(ONE_LINE_INSTALL_IN) + "docs/release-notes/v1.1.0.md"} <= notes + unheld = sorted(notes - set(ONE_LINE_INSTALL_IN)) + assert not unheld, ( + f"{unheld} are release notes, so they are held, not named in " + "RELEASE_NOTES_WITHOUT_THE_ONE_LINE_INSTALL") def test_every_handbook_copy_of_the_one_line_install_is_the_same():