Repository navigation
Exclude agent worktrees from Vitest runs - #1515
Merged
Merged
Conversation
Path filters are substring matches, so running a test by path from a checkout with worktrees under .claude/worktrees also ran the same file in every worktree.
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
Vitest path filters are substring matches, and
.claude/worktrees/is not in the default excludes. Running a test by path from a checkout that has agent worktrees under.claude/worktrees/therefore also ran the same file in every worktree. With 29 worktrees,npx vitest run packages/modules/couchbase/src/couchbase-container.test.tsstarted the Couchbase tests 30 times in parallel.This adds
.claude/worktrees/**to the Vitestexcludelist, keeping the defaults. The pattern is relative to the Vitest root, so tests still run normally from inside a worktree.Verification
npm run format,npm run lint,npm run knip: pass.npx vitest list --filesOnly packages/modules/couchbase/src/couchbase-container.test.tsfrom the main checkout: 30 files before, 1 after.--rootand this config still lists that worktree's test file.Not breaking
Test configuration only. CI has no
.claude/worktrees/directory, so the set of tests it runs is unchanged.