Skip to content

fix(testController): exclude .bundle and vendor/bundle from test discovery - #4210

Open
bodapatisaikrishna wants to merge 1 commit into
Shopify:mainfrom
bodapatisaikrishna:fix/exclude-bundle-from-test-discovery
Open

bodapatisaikrishna wants to merge 1 commit into
Shopify:mainfrom
bodapatisaikrishna:fix/exclude-bundle-from-test-discovery

Conversation

@bodapatisaikrishna

Copy link
Copy Markdown

Fixes #3949.

Problem

When gems are installed locally into the repository (for example via bundle install --path .bundle/gems or --deployment), test discovery automatically scanned .bundle/gems and vendor/bundle. This caused gem test files to be populated into the VS Code test explorer sidebar alongside workspace tests.

Solution

  1. Defined TEST_FILE_EXCLUDE_PATTERN = "**/{.bundle,vendor/bundle}/**".
  2. Passed testExcludePattern to vscode.workspace.findFiles in gatherWorkspaceTests and top-level workspace detection so these directories are not scanned.
  3. Added path checks in shouldSkipTestFile to ignore any test files containing .bundle or vendor/bundle components in their path.

Testing

  • Added unit test in vscode/src/test/suite/testController.test.ts verifying that findFiles receives the .bundle and vendor/bundle exclusion pattern.
  • Validated TypeScript syntax.

…overy

Fixes Shopify#3949.

When gems are installed locally into .bundle/gems or vendor/bundle (e.g. via
bundle install --path or --deployment), test discovery scanned and added all
gem test files into the test explorer.

This:
1. Defines TEST_FILE_EXCLUDE_PATTERN for '**/{.bundle,vendor/bundle}/**'.
2. Passes testExcludePattern to vscode.workspace.findFiles so excluded directories
   are skipped during initial and full test collection.
3. Checks for .bundle and vendor/bundle in shouldSkipTestFile as an additional safeguard.
4. Adds unit test asserting findFiles is called with the exclude pattern.
@bodapatisaikrishna
bodapatisaikrishna requested a review from a team as a code owner September 17, 2026 08:59
@bodapatisaikrishna

Copy link
Copy Markdown
Author

I have signed the CLA!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test path pattern (TEST_PATH_PATTERN) discovers tests from .bundle/gems and vendor/bundle

1 participant