Skip to content

test_runner: use run() options with isolation="none" - #62269

Open
inukshuk wants to merge 1 commit into
nodejs:mainfrom
inukshuk:fix/test-runner-no-isolation-missing-opts
Open

test_runner: use run() options with isolation="none"#62269
inukshuk wants to merge 1 commit into
nodejs:mainfrom
inukshuk:fix/test-runner-no-isolation-missing-opts

Conversation

@inukshuk

Copy link
Copy Markdown

When using run() programatically with isolation="none", testNamePatterns, testSkipPatterns, and only were ignored. This combination of options only worked when set via CLI flags, because parseCommandLine() is still used to seed globalOptions.

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 in globalOptions: the only way for them to be there is via parseCommandLine() above. However, I believe we need to always override them. When run() 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).

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Mar 15, 2026
@codecov

codecov Bot commented Mar 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.13%. Comparing base (cf30b2e) to head (c61404d).
⚠️ Report is 11 commits behind head on main.

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     
Files with missing lines Coverage Δ
lib/internal/test_runner/runner.js 94.86% <100.00%> (+0.05%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@inukshuk
inukshuk force-pushed the fix/test-runner-no-isolation-missing-opts branch from 8637ae0 to 4aa5683 Compare May 15, 2026 10:39
@inukshuk

Copy link
Copy Markdown
Author

I rebased this on main to make sure it's still working.

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.

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label May 16, 2026
@mcollina

Copy link
Copy Markdown
Member

The commit is missing the signoff.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 16, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@inukshuk
inukshuk force-pushed the fix/test-runner-no-isolation-missing-opts branch from 4aa5683 to c4f6220 Compare May 17, 2026 10:14
@inukshuk

Copy link
Copy Markdown
Author

My apologies, it's my first PR here. I've squashed the two commits and updated the commit message

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

@github-actions github-actions Bot added the stale label Aug 16, 2026
@inukshuk

Copy link
Copy Markdown
Author

I think this is ready to merge. Happy to make any changes if necessary!

@jasnell

jasnell commented Aug 17, 2026

Copy link
Copy Markdown
Member

@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 main then we'll run CI on it again.

@github-actions github-actions Bot removed the stale label Aug 18, 2026
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>
@inukshuk
inukshuk force-pushed the fix/test-runner-no-isolation-missing-opts branch from c4f6220 to c61404d Compare August 18, 2026 08:48
@inukshuk

Copy link
Copy Markdown
Author

I re-based on origin/main and ran the tests again locally; force pushed the PR branch.

@atlowChemi atlowChemi added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Aug 18, 2026
@github-actions github-actions Bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor
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

@atlowChemi atlowChemi removed the request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. label Aug 18, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test runner run() ignores testNamePatterns and testSkipPatterns when isolation is "none"

7 participants