test(canonical-urls): a stale URL elsewhere is reported once, not as three failed cleanups #2032

Closed
jaylouisw wants to merge 1 commit from fix/1118-2037 into main
Owner

Fixes #2030

Measured on main (05ed9322), one stale URL planted in a file no probe touches:

  \u2717 no file points at the old repository (1 problems)
  \u2717 and the tree is clean again once the probe is removed
  \u2717 and the README is restored
  \u2717 and the tree is clean again once the probe is removed
48 passed, 4 failed

The last three all ended with ok(check().ok, ...), i.e. "the whole tree is clean", not "my probe was cleaned up". and the README is restored failed while and the README is restored byte for byte - the assertion two lines further down - passed on the same run. The suite contradicted itself, and the three extra failures sent a reader looking at probe cleanup instead of at the stale URL the first line had already named, with its file and line printed underneath.

PR #1980 is that scenario today: docs/plans/changelog-discipline.md:36 quotes github.com/Jaylouisw/packetforge as the changelog footer's evidence, and all three Node legs read 48 passed, 4 failed.

Change, test/canonical-urls.test.js only:

  • the three post-probe assertions ask about their own probe: nothing reported for docs/__drift_probe.md, no E_NO_CANONICAL_CLONE left, no E_BADGE_NO_WORKFLOW left;
  • the README section gains the byte-for-byte restore check its sibling already had;
  • the whole-tree guard stays exactly where it was, at the top of the suite, so a stale URL is still a build failure - reported once, with the file and line to fix;
  • a regression case plants a stale URL outside every probe path and pins that it is reported once, against its own file, and does not accuse the probes or invent a dead badge.

Guard strength unchanged: check() still fails the tree on a planted URL, and the suite still proves every probe can fail.

Gates

  • node scripts/syntax-check.js - 422 files, all OK
  • node test/canonical-urls.test.js - 61 passed, 0 failed (was 52); with one stale URL planted elsewhere: 60 passed, 1 failed, the one failure being the true one, and the same for the #1980 file verbatim
  • npm test - 348 suites, 12074 assertions, 0 failed

No engine, server or catalogue code touched. Nothing else changed.

Fixes #2030 **Measured on main (05ed9322), one stale URL planted in a file no probe touches:** ``` \u2717 no file points at the old repository (1 problems) \u2717 and the tree is clean again once the probe is removed \u2717 and the README is restored \u2717 and the tree is clean again once the probe is removed 48 passed, 4 failed ``` The last three all ended with `ok(check().ok, ...)`, i.e. "the whole tree is clean", not "my probe was cleaned up". `and the README is restored` failed while `and the README is restored byte for byte` - the assertion two lines further down - passed on the same run. The suite contradicted itself, and the three extra failures sent a reader looking at probe cleanup instead of at the stale URL the first line had already named, with its file and line printed underneath. PR #1980 is that scenario today: `docs/plans/changelog-discipline.md:36` quotes `github.com/Jaylouisw/packetforge` as the changelog footer's evidence, and all three Node legs read `48 passed, 4 failed`. **Change**, `test/canonical-urls.test.js` only: - the three post-probe assertions ask about their own probe: nothing reported for `docs/__drift_probe.md`, no `E_NO_CANONICAL_CLONE` left, no `E_BADGE_NO_WORKFLOW` left; - the README section gains the byte-for-byte restore check its sibling already had; - the whole-tree guard stays exactly where it was, at the top of the suite, so a stale URL is still a build failure - reported once, with the file and line to fix; - a regression case plants a stale URL outside every probe path and pins that it is reported once, against its own file, and does not accuse the probes or invent a dead badge. Guard strength unchanged: `check()` still fails the tree on a planted URL, and the suite still proves every probe can fail. **Gates** - `node scripts/syntax-check.js` - 422 files, all OK - `node test/canonical-urls.test.js` - 61 passed, 0 failed (was 52); with one stale URL planted elsewhere: `60 passed, 1 failed`, the one failure being the true one, and the same for the #1980 file verbatim - `npm test` - 348 suites, 12074 assertions, 0 failed No engine, server or catalogue code touched. Nothing else changed.
test(canonical-urls): a stale URL elsewhere is reported once, not as three failed cleanups
All checks were successful
CI / Classify the change (pull_request) Successful in 6s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 8s
CI / Server smoke test (pull_request) Successful in 11s
CI / Docker build (pull_request) Successful in 21s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 22) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m1s
CI / Arm auto-merge (pull_request) Successful in 20s
6bf637da95
The three assertions that follow a planted probe ended with check().ok, which
answers for the whole tree. A stale URL anywhere else therefore failed them as
well, and printed 'and the README is restored' next to a byte-for-byte check on
the same run that passed. PR #1980 read 48 passed / 4 failed for one line of
prose.

They now assert what their names say - nothing is reported for the probe path,
no E_NO_CANONICAL_CLONE, no E_BADGE_NO_WORKFLOW - while the whole-tree guard at
the top of the suite still reports a stale URL once, with its file and line. A
regression case plants a stale URL outside every probe path and pins that.

Fixes #2030
forgejo-actions force-pushed fix/1118-2037 from 6bf637da95
All checks were successful
CI / Classify the change (pull_request) Successful in 6s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 8s
CI / Server smoke test (pull_request) Successful in 11s
CI / Docker build (pull_request) Successful in 21s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 22) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m1s
CI / Arm auto-merge (pull_request) Successful in 20s
to b43338d2d0 2026-11-18 20:48:52 +00:00
Compare
Author
Owner

Superseded — closing, not merging.

Main already carries this change. PR #2036 (squashed to 80bb55fe, merged 21:11:58Z) landed the same fix in test/canonical-urls.test.js and closed #2030 at 21:12:03Z:

  • the scoped helper is problemsFor(rel) / problemsWithCode(code) on main (line 34), the same idea as this PR's reportedFor / reportedCodes — just named differently;
  • both post-probe assertions now ask about their own probe (problemsFor('docs/__drift_probe.md'), lines 90/109/145/228);
  • the byte-for-byte README restore checks exist on both sides (lines 147, 230);
  • and the regression test this PR adds as docs/__elsewhere_stale.md already exists on main as the docs/__stray_stale.md block ("A stale URL outside the probe paths is reported once, and blames only itself", lines 65–92) — it asserts the same three properties: exactly one problem, reported against the file and line that holds it, and no report filed against a probe that is not on disk.

Verified by rebasing locally onto a603c7f7: the only conflict is this overlap (problemsFor vs reportedFor, two versions of the same test block), and the branch's delta against main after resolution is zero — 50 ok() on main, 52 here, with the two extra being the duplicate stray-URL block.

No content is lost by closing. If you want #2032's exact wording of that test kept instead of #2036's, say so and I will reopen and rebase it on top of the #2036 text rather than choose for you.

Superseded — closing, not merging. Main already carries this change. PR #2036 (squashed to **80bb55fe**, merged 21:11:58Z) landed the same fix in `test/canonical-urls.test.js` and closed #2030 at 21:12:03Z: - the scoped helper is `problemsFor(rel)` / `problemsWithCode(code)` on main (line 34), the same idea as this PR's `reportedFor` / `reportedCodes` — just named differently; - both post-probe assertions now ask about their own probe (`problemsFor('docs/__drift_probe.md')`, lines 90/109/145/228); - the byte-for-byte README restore checks exist on both sides (lines 147, 230); - and the regression test this PR adds as `docs/__elsewhere_stale.md` already exists on main as the `docs/__stray_stale.md` block ("A stale URL outside the probe paths is reported once, and blames only itself", lines 65–92) — it asserts the same three properties: exactly one problem, reported against the file and line that holds it, and no report filed against a probe that is not on disk. Verified by rebasing locally onto `a603c7f7`: the only conflict is this overlap (`problemsFor` vs `reportedFor`, two versions of the same test block), and the branch's delta against main after resolution is zero — 50 `ok()` on main, 52 here, with the two extra being the duplicate stray-URL block. No content is lost by closing. If you want #2032's exact wording of that test kept instead of #2036's, say so and I will reopen and rebase it on top of the #2036 text rather than choose for you.
jaylouisw closed this pull request 2026-11-18 21:39:10 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2032
No description provided.