Skip to content

Conversation

AlexCannonball
Copy link

Fixes #59593 (a part related to the XML failure:message attribute value)

Cause

In escapeAttribute line feed characters were simply removed, so multi-line messages were distorted in the report, like:

The value must be 01 !== 0

However, the original message is:

The value must be 0

1 !== 0

Solution motivation

https://www.w3.org/TR/WD-xml-970807#sec3.3.3

Character references and references to internal text entities must be expanded

Thus, the character reference 
 must be expanded by the XML report processor/application to the line feed character.

Changes

I used the decimal code 
 as a decimal one is already used in escapeComment.

/(&)(?!#\d{1,7};)/g in escapeContent prevents escaping & in decimal character references.

Updated the test snapshot.

Effect

-		<failure type="testCodeFailure" message="Expected values to be strictly equal:true !== false">
+		<failure type="testCodeFailure" message="Expected values to be strictly equal:&#10;&#10;true !== false">

Testing

image

Additional details

I haven't removed testcase:failure as it's submitted via #59685

Replaces line feed characters with the correct character reference in
XML attribute values.
@nodejs-github-bot
Copy link
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 Oct 15, 2025
@targos targos added dont-land-on-v25.x PRs that should not land on the v25.x-staging branch and should not be released in v25.x. and removed dont-land-on-v25.x PRs that should not land on the v25.x-staging branch and should not be released in v25.x. labels Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.57%. Comparing base (a520a39) to head (60c9808).
⚠️ Report is 35 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/reporter/junit.js 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60274      +/-   ##
==========================================
+ Coverage   88.56%   88.57%   +0.01%     
==========================================
  Files         704      704              
  Lines      208323   208323              
  Branches    40033    40039       +6     
==========================================
+ Hits       184501   184531      +30     
+ Misses      15854    15806      -48     
- Partials     7968     7986      +18     
Files with missing lines Coverage Δ
lib/internal/test_runner/reporter/junit.js 94.47% <66.66%> (ø)

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

@atlowChemi atlowChemi added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 19, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 19, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

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

Labels

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.

JUnit XML failure element and attribute are incorrect when using node:assert

5 participants