Skip to content

test_runner: add handleSignals option to run() - #64357

Open
mete0rfish wants to merge 1 commit into
nodejs:mainfrom
mete0rfish:feat-configure-signal
Open

test_runner: add handleSignals option to run()#64357
mete0rfish wants to merge 1 commit into
nodejs:mainfrom
mete0rfish:feat-configure-signal

Conversation

@mete0rfish

Copy link
Copy Markdown
Contributor

Implements the TODO from #43977


The built-in test runner already handles SIGINT and SIGTERM, marking any running tests as interrupted before exiting. The run() API, however, did not provide a way to enable the same behavior.

This change adds an opt-in handleSignals option for test runner integrations:

run({files: ['test.js'],handleSignals: true,});

Signal handling remains disabled by default, so existing run() users that manage process signals themselves are unaffected. Custom runners can now opt in when they need behavior consistent with the CLI test runner.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 8, 2026
Signed-off-by: mete0rfish <sungwon326@naver.com>
@mete0rfish
mete0rfishforce-pushed the feat-configure-signal branch from 463edaa to 0bfc0f9CompareJuly 8, 2026 13:01
@codecov

codecovBot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.27%. Comparing base (e6a8d06) to head (0bfc0f9).
⚠️ Report is 379 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/test_runner/harness.js75.00%3 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #64357 +/- ##
==========================================
- Coverage 92.01% 90.27% -1.75% 
==========================================
Files 379 741 +362 Lines 166972 241004 +74032 Branches 25554 45422 +19868 ==========================================
+ Hits 153639 217558 +63919 - Misses 13041 15018 +1977 - Partials 292 8428 +8136 
Files with missing linesCoverage Δ
lib/internal/test_runner/runner.js94.45% <100.00%> (+0.39%)⬆️
lib/internal/test_runner/harness.js93.10% <75.00%> (+4.97%)⬆️

... and 548 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.

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

Labels

needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mete0rfish@nodejs-github-bot