extend CI test-plan basename lookup to every text-reading contract test - #6384
Merged
Conversation
…ct test (#6363) `scripts/ci-test-plan.js` already computed a `git grep`-by-basename fallback for python sidecar scripts, since Vitest's import graph can never reach them. The same gap applied to any JS-side test that reads its subject as text instead of importing it — the server/client mirror parity tests (30+ `*.mirror.test.js` / `*.parity.test.js`) and `server/lib/navManifest.test.js`, which reads 20+ client files by path. A PR editing only one side of a mirror, or adding a page tab, merged green while the actual contract test never ran. Generalizes that lookup (`sourceReferencePattern`, `pathContractTests`) from python-only to every changed executable source, additively for non-python sources so an empty hit list is not an error. Adds a structural rule for `mirrorCoverage.test.js`, which reads directories rather than naming a file and so stays unreachable even by basename. Extends `scripts/repo-scan-guards.test.js` with a second classifier (`readsUnnamedCrossRootFile`) so a future text-reading guard that never names its target can't land unreachable the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/ci-test-plan.jsalready had agit grep-by-basename fallback for python sidecar scripts, since Vitest's import graph can never reach them. The same gap applied to any test that reads its subject as text instead of importing it — the 30+ server/client mirror parity tests andserver/lib/navManifest.test.js(which reads 20+ client files by path). A PR editing only one side of a mirror, or adding a page tab, merged green while the contract test that guards it never ran.pythonReferencePattern/pythonContractTests→sourceReferencePattern/pathContractTests) to every changed executable source. It's additive for non-python sources — an empty hit list is not an error, since those files are already reachable through the import graph or a feature directory.server/lib/mirrorCoverage.test.jswheneverserver/lib/orclient/src/lib/changes, since that test reads directories rather than naming a file and stays unreachable even by basename.scripts/repo-scan-guards.test.jswith a second classifier (readsUnnamedCrossRootFile) so a future text-reading guard that never names its target file can't land unreachable the same way — it must register inALWAYS_RUN_TESTS/STRUCTURALLY_SELECTEDinstead.git greppathspecs from a hardcoded*.test.js/.jsxpair to*.test.*/*.spec.*so a future.test.ts(x)contract test isn't silently missed (caught in local review).Test plan
cd server && npx vitest run ../scripts/ci-test-plan.test.js ../scripts/repo-scan-guards.test.js— 55 tests pass, including the new cases forclient/src/pages/Calendar.jsx→navManifest.test.js, either side ofseasonStructure.js→seasonStructure.mirror.test.js, and themirrorCoverage.test.jsstructural rule.git grep(not mocked): aCalendar.jsxchange findsnavManifest.test.js, and aseasonStructure.jschange findsseasonStructure.mirror.test.js.cd server && npm test— full suite (2007 files / 39919 tests) passes.Closes #6363