Make test:integration runnable outside a POSIX shell - #57
Merged
Conversation
The script inlined four things cmd.exe does not have:
rm -rf out/src/test/integration && ... && { find src -name '*.js' \
-not -path 'src/test/*' -delete 2>/dev/null || true; } && vscode-test
npm runs scripts through cmd.exe on Windows, so `rm` and `find` do not exist,
`/dev/null` is not a path, and `{ ...; }` is not a group. Verified directly:
cmd /c "rm -rf out/src/test/integration"
-> 'rm' is not recognized as an internal or external command
The whole integration suite was therefore unrunnable on Windows. Same class as
the `mkdir -p` in copy-grammars (3c1bae3), which silently skipped every
tree-sitter suite rather than failing.
Replaced with scripts/integration-clean.mjs in two modes: `pre` removes the
previous build output, `post` prunes stray compiled .js outside src/test.
The post step swallows per-file removal errors, matching the `|| true` the
shell version ended with -- a stray file that cannot be deleted must not fail
the test run.
Found by auditing all 40 npm scripts for POSIX-only constructs after two of
them turned out to be broken on Windows. This was the only remaining one; the
two other regex hits were false positives (cross-env already handles a second
VAR= on the same line).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ All checks passed
Posted by SideCarAI-Bot |
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.
npm run test:integrationinlined four things cmd.exe does not have, so the entire integration suite was unrunnable on Windows:npm runs scripts through cmd.exe on Windows, where
rmandfinddo not exist,/dev/nullis not a path, and{ ...; }is not a group. Verified directly rather than assumed:Same class as the
mkdir -pincopy-grammars(3c1bae3), which silently skipped every tree-sitter suite instead of failing — that one cost real coverage before anyone noticed.What changed
scripts/integration-clean.mjsin two modes, replacing the shell steps:pre— remove the previous integration build outputpost— prune stray compiled.jsoutsidesrc/test, swallowing per-file errors to match the|| truethe shell version ended with. A stray file that cannot be removed must not fail the test run.How it was found
Audited all 40 npm scripts for POSIX-only constructs after two of them turned out to be broken on Windows. This was the only remaining one. The two other regex hits were false positives —
cross-envalready handles a secondVAR=on the same line.🤖 Generated with Claude Code