test_runner: use run() options with isolation="none"#62269
Open
inukshuk wants to merge 2 commits intonodejs:mainfrom
Open
test_runner: use run() options with isolation="none"#62269inukshuk wants to merge 2 commits intonodejs:mainfrom
inukshuk wants to merge 2 commits intonodejs:mainfrom
Conversation
When using run() programatically with isolation="none", testNamePatterns, testSkipPattersn, and only were ignored. This combination of options only worked when set via CLI flags, because parseCommandLine() is still used to seed globalOptions.
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62269 +/- ##
==========================================
- Coverage 89.67% 89.67% -0.01%
==========================================
Files 676 676
Lines 206555 206568 +13
Branches 39552 39565 +13
==========================================
+ Hits 185225 185230 +5
- Misses 13448 13454 +6
- Partials 7882 7884 +2
🚀 New features to boost your workflow:
|
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.
When using
run()programatically with isolation="none",testNamePatterns,testSkipPatterns, andonlywere ignored. This combination of options only worked when set via CLI flags, becauseparseCommandLine()is still used to seedglobalOptions.Closes #57399
This is almost the same as #58496 which was my starting point for this. The original PR did not address
only, which is equally missing. It also did not overwrite the options if they were already inglobalOptions: the only way for them to be there is viaparseCommandLine()above. However, I believe we need to always override them. Whenrun()is used in code with these options, I'd always expect them to take effect and this is also what already happens with isolation="process", which forward the run() options to the child process not the CLI ones.This also uses a fixture for running the tests as was requested in the original PR.
The test spawns a child process, because running a test within the currently running test without isolation is problematic (tests would hang for me, could be related to #57394 but it's arguably not something that should be done).