Skip to content

test_runner: add timestamp to JUnit reporter testsuites#64029

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
Han5991:feat/test-runner-junit-timestamp
Jun 22, 2026
Merged

test_runner: add timestamp to JUnit reporter testsuites#64029
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
Han5991:feat/test-runner-junit-timestamp

Conversation

@Han5991

@Han5991 Han5991 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Adds the standard JUnit timestamp attribute (ISO 8601) to <testsuite> elements, which the reporter was omitting. Major CI tools (Jenkins / GitLab / Azure DevOps) use it to order suites from parallel runs and to build test-trend history, and other producers (pytest, jest-junit, mocha-junit-reporter, Maven Surefire) all emit it.

The suite start time is derived as end-minus-duration, because the runner reports a suite's test:start lazily (when its first subtest reports) — stamping at that moment would otherwise record a time close to the suite's end.

The exact value format (full ISO-8601 with Z vs the legacy no-timezone Ant form) is an open question — see #64028. This currently emits Date.prototype.toISOString() (UTC, Z).

Fixes: #64028

Emit the standard JUnit timestamp (ISO 8601) on <testsuite> elements,
which the reporter was omitting. The suite start time is reconstructed
as end-minus-duration, because the runner reports a suite's test:start
lazily (when its first subtest reports), which would otherwise record a
time close to the suite's end.

Fixes: nodejs#64028
Signed-off-by: sangwook <rewq5991@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 Jun 20, 2026
Signed-off-by: sangwook <rewq5991@gmail.com>
@MoLow MoLow added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 21, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 21, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@JakobJingleheimer JakobJingleheimer added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Jun 22, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 22, 2026
@nodejs-github-bot nodejs-github-bot merged commit 546b596 into nodejs:main Jun 22, 2026
76 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 546b596

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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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: JUnit reporter omits the timestamp attribute on <testsuite>

4 participants