test(canonical-urls): a post-probe check answers for its probe, not the tree #2036
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!2036
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1118-2102"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2030
Three assertions ended with
ok(check().ok, ...)after their probe was removed, andcheck().okis the whole tree. One stale URL in a file no probe touches therefore produced four failures: the honest one at the top with its file and line, plus three that claimed "the probe left residue" and "the README is not restored" - whileand the README is restored byte for byte, two lines below, passed on the same run.Reproduced first
With
docs/__unrelated_stale.mdplanted (the issue's own repro):Changed (
test/canonical-urls.test.js)problemsFor(rel)/problemsWithCode(code)scope a claim to what the probe touched.E_NO_CANONICAL_CLONEproblem remains", plus a byte-for-byte restore check.E_BADGE_NO_WORKFLOWproblem remains".:47is untouched - that is where a stray URL belongs, once, with its file and line.Non-vacuity
Mutating the README cleanup to a silent no-op fails both new README assertions, so they still detect the defect they name.
Gates
node scripts/syntax-check.js- 423 files, all OKnode test/canonical-urls.test.js- 58 passed, 0 failednode scripts/run-tests.js --filter=canonical- 1 suite, 58 assertions passed, 0 failedNot touched:
.forgejo/workflows/ci.yml:677still refers to the old assertion name"the tree is clean again"in a historical benchmark note. Left for the CI stream.