Skip to content

test_runner: fix quote escaping in JUnit - #65971

Open
hanityx wants to merge 1 commit into
nodejs:mainfrom
hanityx:test-runner-junit-quote
Open

test_runner: fix quote escaping in JUnit#65971
hanityx wants to merge 1 commit into
nodejs:mainfrom
hanityx:test-runner-junit-quote

Conversation

@hanityx

@hanityx hanityx commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Double quotes in JUnit attribute values are escaped twice: first as
", then as ". An XML reader gets the text "
instead of a double quote.

Call escapeContent() before replacing quotes and newlines.

Add a snapshot test for repeated quotes, literal ", and quotes
mixed with &, <, or a newline.

Refs: #60274

Escape XML content before replacing double quotes and line feeds.

Add a snapshot test for repeated quotes, literal quote references,
and quotes mixed with ampersands, less-than signs, or a newline.

Signed-off-by: hanityx <hanityx@gmail.com>
@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 Sep 10, 2026
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.18%. Comparing base (fd6682c) to head (2652c0e).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65971      +/-   ##
==========================================
+ Coverage   90.16%   90.18%   +0.02%     
==========================================
  Files         771      771              
  Lines      265445   265470      +25     
  Branches    50455    50459       +4     
==========================================
+ Hits       239329   239421      +92     
+ Misses      17056    17002      -54     
+ Partials     9060     9047      -13     
Files with missing lines Coverage Δ
lib/internal/test_runner/reporter/junit.js 94.76% <100.00%> (ø)

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

@meixg meixg 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 Sep 11, 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 Sep 11, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. 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.

4 participants