Skip to content

test_runner: junit fixes - #67160

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
avivkeller:test-runner-junit-fixes
Nov 20, 2026
Merged

nodejs-github-bot merged 2 commits into
nodejs:mainfrom
avivkeller:test-runner-junit-fixes

Conversation

@avivkeller

Copy link
Copy Markdown
Member

Fixes: #67155
Fixes: #67149

Adds sanitization + flushing to the Junit reporter, fixing the aforementioned issues.

Signed-off-by: avivkeller me@aviv.sh

Signed-off-by: avivkeller <me@aviv.sh>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@avivkeller
avivkeller marked this pull request as ready for review October 31, 2026 13:23

@avivkeller avivkeller left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not meant to be a draft...

@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 Oct 31, 2026
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.68421% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.67%. Comparing base (d44625a) to head (9060451).
⚠️ Report is 320 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/reporter/junit.js 98.64% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67160      +/-   ##
==========================================
- Coverage   90.69%   90.67%   -0.03%     
==========================================
  Files         797      800       +3     
  Lines      278787   280543    +1756     
  Branches    53607    54184     +577     
==========================================
+ Hits       252858   254386    +1528     
+ Misses      16292    16277      -15     
- Partials     9637     9880     +243     
Files with missing lines Coverage Δ
lib/internal/test_runner/test.js 97.95% <100.00%> (-0.04%) ⬇️
lib/internal/test_runner/reporter/junit.js 99.10% <98.64%> (+4.33%) ⬆️

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

node.attrs.classname = 'test';
node.attrs.failure = message;
ArrayPrototypePush(node.children, {
__proto__: null, nesting: node.nesting + 1, tag: 'failure',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, use __proto__: kEmptyObject (kEmptyObject is in internal/util) to keep the object in fast-properties mode.

closeUnfinished(event.data.nesting);
const originalSuite = currentSuite;
currentSuite = {
__proto__: null,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you're in here making changes anyway, might be worthwhile switching this to __proto__: kEmptyObject. Worth checking.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 17, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jasnell jasnell added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 18, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 18, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@avivkeller avivkeller added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 20, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 20, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Commit Queue failed

This pull request has multiple commits, but no landing policy was selected.

Add commit-queue-squash PRs the Commit Queue should land as one squashed commit. to land it as one commit, or commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. to land the commits separately.

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
�[36m⠋�[39m Loading data for nodejs/node/pull/67160
�[36m⠋�[39m Loading data for nodejs/node/pull/67160
�[36m⠋�[39m Getting collaborator contacts from README of nodejs/node
�[36m⠋�[39m Getting PR from nodejs/node/pull/67160
�[36m⠋�[39m Getting reviews from nodejs/node/pull/67160
�[36m⠋�[39m Getting comments from nodejs/node/pull/67160
�[36m⠋�[39m Getting commits from nodejs/node/pull/67160
✔  Done loading data for nodejs/node/pull/67160
----------------------------------- PR info ------------------------------------
Title      test_runner: junit fixes (#67160)
Author     Aviv Keller <me@aviv.sh> (@avivkeller)
Branch     avivkeller:test-runner-junit-fixes -> nodejs:main
Labels     needs-ci, commit-queue, test_runner
Commits    2
 - test_runner: junit fixes
 - fixup!
Committers 1
 - avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/67160
Fixes: https://github.com/nodejs/node/issues/67155
Fixes: https://github.com/nodejs/node/issues/67149
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/67160
Fixes: https://github.com/nodejs/node/issues/67155
Fixes: https://github.com/nodejs/node/issues/67149
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sat, 31 Oct 2026 13:23:24 GMT
   ✔  Approvals: 3
   ✔  - Moshe Atlow (@MoLow): https://github.com/nodejs/node/pull/67160#pullrequestreview-5917214523
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/67160#pullrequestreview-5922131722
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/67160#pullrequestreview-5937555842
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-11-18T16:38:10Z: https://ci.nodejs.org/job/node-test-pull-request/79271/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79271/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79271/
�[36m⠙�[39m Querying API for job/node-test-pull-request/79271/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
�[36m⠹�[39m Querying API for job/node-test-pull-request/79271/
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
�[36m⠹�[39m Querying API for job/node-test-pull-request/79271/
�[36m⠹�[39m Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
�[36m⠸�[39m Downloading patch for 67160
�[36m⠸�[39m Downloading patch for 67160
From https://github.com/nodejs/node
 * branch                  refs/pull/67160/merge -> FETCH_HEAD
✔  Fetched commits as 3c26849e1724..90604513df0b
--------------------------------------------------------------------------------
Auto-merging lib/internal/test_runner/reporter/junit.js
Auto-merging lib/internal/test_runner/test.js
[main d218bd9226] test_runner: junit fixes
 Author: avivkeller <me@aviv.sh>
 Date: Sat Oct 31 14:22:26 2026 +0100
 5 files changed, 213 insertions(+), 12 deletions(-)
 create mode 100644 test/fixtures/test-runner/junit-colored-diff.js
 create mode 100644 test/parallel/test-runner-force-exit-stdout-drain.js
 create mode 100644 test/parallel/test-runner-junit-invalid-xml.js
Auto-merging lib/internal/test_runner/reporter/junit.js
[main b73f0e90f5] fixup!
 Author: avivkeller <me@aviv.sh>
 Date: Mon Nov 16 22:39:36 2026 -0500
 1 file changed, 17 insertions(+), 12 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
(node:387) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: junit fixes

Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/67160
Fixes: https://github.com/nodejs/node/issues/67155
Fixes: https://github.com/nodejs/node/issues/67149
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD e6bb1ede2e] test_runner: junit fixes
 Author: avivkeller <me@aviv.sh>
 Date: Sat Oct 31 14:22:26 2026 +0100
 5 files changed, 213 insertions(+), 12 deletions(-)
 create mode 100644 test/fixtures/test-runner/junit-colored-diff.js
 create mode 100644 test/parallel/test-runner-force-exit-stdout-drain.js
 create mode 100644 test/parallel/test-runner-junit-invalid-xml.js
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fixup!

PR-URL: https://github.com/nodejs/node/pull/67160
Fixes: https://github.com/nodejs/node/issues/67155
Fixes: https://github.com/nodejs/node/issues/67149
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 30534808d6] fixup!
 Author: avivkeller <me@aviv.sh>
 Date: Mon Nov 16 22:39:36 2026 -0500
 1 file changed, 17 insertions(+), 12 deletions(-)
Successfully rebased and updated refs/heads/main.
--------------------------------------------------------------------------------
   ℹ  Add `commit-queue-squash` label to land the PR as one commit, or `commit-queue-rebase` to land as separate commits.

View workflow run

@avivkeller avivkeller added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Nov 20, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 030745c into nodejs:main Nov 20, 2026
80 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 030745c

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

5 participants