fix(testController): exclude .bundle and vendor/bundle from test discovery - #4210
Open
bodapatisaikrishna wants to merge 1 commit into
Open
bodapatisaikrishna wants to merge 1 commit into
bodapatisaikrishna wants to merge 1 commit into
Conversation
…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.
Author
|
I have signed the CLA! |
This branch has not been deployed
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.
Fixes #3949.
Problem
When gems are installed locally into the repository (for example via
bundle install --path .bundle/gemsor--deployment), test discovery automatically scanned.bundle/gemsandvendor/bundle. This caused gem test files to be populated into the VS Code test explorer sidebar alongside workspace tests.Solution
TEST_FILE_EXCLUDE_PATTERN = "**/{.bundle,vendor/bundle}/**".testExcludePatterntovscode.workspace.findFilesingatherWorkspaceTestsand top-level workspace detection so these directories are not scanned.shouldSkipTestFileto ignore any test files containing.bundleorvendor/bundlecomponents in their path.Testing
vscode/src/test/suite/testController.test.tsverifying thatfindFilesreceives the.bundleandvendor/bundleexclusion pattern.