test_runner: use run() options with isolation="none" - #62269
Conversation
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62269 +/- ##
==========================================
+ Coverage 90.11% 90.13% +0.02%
==========================================
Files 752 752
Lines 251861 251873 +12
Branches 47365 47361 -4
==========================================
+ Hits 226955 227024 +69
+ Misses 16238 16175 -63
- Partials 8668 8674 +6
🚀 New features to boost your workflow:
|
8637ae0 to
4aa5683
Compare
|
I rebased this on For added context, I'm working with the test runner in Electron where there are substantial differences to the process model and it would be very helpful to have all the run() options available even with isolation turned off. Happy to explore this further/differently if that would be preferable. |
|
The commit is missing the signoff. |
4aa5683 to
c4f6220
Compare
|
My apologies, it's my first PR here. I've squashed the two commits and updated the commit message |
|
This pull request has been marked as stale due to 90 days of inactivity. |
|
I think this is ready to merge. Happy to make any changes if necessary! |
|
@inukshuk ... since it's been a couple months since CI was run on this and because you've pushed commit after that CI was run, can I ask you to rebase this to latest |
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. Fixes: nodejs#57399 Signed-off-by: Sylvester Keil <sylvester@keil.or.at>
c4f6220 to
c61404d
Compare
|
I re-based on |
Failed to start CI- Validating Jenkins credentials ✔ Jenkins credentials valid - Querying data for job/node-test-pull-request/73491/ SyntaxError: Unexpected token '<', ..." https://github.com/nodejs/node/actions/runs/32127626402 |
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).