Repository navigation
Respect TestRunRequest.exclude when running tests - #26273
Open
Rahmat Eka Satria (rhmatzeka) wants to merge 1 commit into
Open
Rahmat Eka Satria (rhmatzeka) wants to merge 1 commit into
Rahmat Eka Satria (rhmatzeka) wants to merge 1 commit into
Conversation
Tests hidden by a Test Explorer filter (or otherwise excluded from the run request) were still started and run. Build the excluded set once, including descendants, and skip those items when expanding the request into test cases, for both the workspace and the project-based paths. If nothing is left after exclusions, don't start the adapter at all: an empty ID list makes pytest run every test. Test-ID deduplication is unchanged. Fixes microsoft#25742 Co-authored-by: Andrew Lavin <alavin@acm.org>
Author
|
@microsoft-github-policy-service agree |
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 #25742. This continues #25743 by Andrew Lavin (@andravin), who said they no longer have time for it; their commits are credited as co-author.
Tests hidden by a Test Explorer filter (anything in
TestRunRequest.exclude) were still started and run. This builds the excluded set once, including descendants, and skips those items when expanding the request into test cases, in both the workspace path (WorkspaceTestAdapter.executeTests) and the project-based path (executeTestsForProjects).The review comments on #25743 are covered:
main, which now has the project-based execution path.[TestClass, test1]withtest2excluded) sendingtest1once.One unrelated test change: the existing "the right tests should be sent to be executed" test stubbed
getTestCaseNodeswithsinon.stubinstead of the suite'ssandbox, so the stub was never restored and leaked into later tests in the suite. It now usessandbox.stub.Testing:
npm run test:unittestspasses for everything undersrc/test/testing/testController(276 tests); 12 of the new tests fail against the old code. The only failures in the full suite are environment-related on my machine (nopythonon PATH, no native locator binary) and are in files this PR doesn't touch.eslintandprettier --checkpass on the changed files.