Repository navigation
test(scripts): skip tracked paths missing from disk in the script gates (#853) - #916
Merged
Merged
Conversation
…es (#853) The gates listed files with `git ls-files` and read every entry, so an unstaged rename or delete crashed them with ENOENT. A shared `trackedFiles` helper now lists the index and keeps only paths that exist on disk; every gate that reads listed files goes through it.
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.
Closes #853
The script gates in
tests/scripts/list files withgit ls-filesand read every entry. The index can name a path that is not on disk (an unstaged rename or delete), so the gate crashed with ENOENT, which reads as a design-token violation rather than a working-tree state.tests/scripts/tracked.mjs:trackedFiles(pathspecs, root)lists the index and keeps only paths that exist on disk.design_tokens,design_system,annotator_boundary,form_buttons,e2e_discipline,cdn_vendor_boundary,media_core_boundary,ui_core_boundary,checks_wiring,cooldown,docs_links).tracked.test.mjs, which runs against a scratch repo with an unstaged deletion; removing the existence filter turns it red.Behaviour change: in
docs_links, a link to a file that is in the index but missing from disk is now reported as broken; before it counted as resolved.Verification:
node --test "tests/scripts/*.test.mjs"on Node 24, 172 pass, 0 fail.