lib: fix testNamePatterns and testSkipPatterns being ignored with isolation "none"#58496
Conversation
|
Review requested:
|
| globalSetupPath, | ||
| }; | ||
|
|
||
| if (isolation === 'none') { |
There was a problem hiding this comment.
Not sure if it's a good approach. See my comment on the issue: #57399 (comment).
There was a problem hiding this comment.
I think it could be a good starting point, but I agree that at first glance, this solution feels "out of place".
I'll take a look as soon as I can and come back with better feedback 🚀
test/parallel/test-runner-run.mjs
Outdated
| }); | ||
| }); | ||
|
|
||
| describe("with isolation set to 'none'",() => { |
There was a problem hiding this comment.
Each of these tests passes individually, but when the whole describe block is run, the second test hangs indefinitely. I think it has something to do with how tests without isolation work, but I haven't found a fix yet.
There was a problem hiding this comment.
I think it has something to do with how tests without isolation work
As you said, the problem is that the runner is running in the same process as the test file.
This is why you're encountering this issue.
You could follow the same logic used here: https://github.com/nodejs/node/blob/main/test/parallel/test-runner-run-watch.mjs
(Basically, by spawning a process that then calls run with isolation: none)
There was a problem hiding this comment.
Hey @pmarchini, sorry for the delay in getting back to this. I’ve followed your suggestion and got the tests working, thanks!
9af076f to
9aeef6c
Compare
9aeef6c to
db62068
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58496 +/- ##
==========================================
- Coverage 90.07% 90.07% -0.01%
==========================================
Files 640 640
Lines 188442 188453 +11
Branches 36971 36975 +4
==========================================
+ Hits 169735 169743 +8
- Misses 11424 11426 +2
- Partials 7283 7284 +1
🚀 New features to boost your workflow:
|
| const testSkipPatterns = options.testSkipPatterns ? JSON.stringify(options.testSkipPatterns) : undefined; | ||
| const isolation = options.isolation ? JSON.stringify(options.isolation) : undefined; | ||
|
|
||
| const code = ` |
There was a problem hiding this comment.
I would suggest moving this to a real fixture!
Fixes #57399.