Skip to content

test_runner: add timestamp to JUnit reporter testsuites#64029

Open
Han5991 wants to merge 2 commits into
nodejs:mainfrom
Han5991:feat/test-runner-junit-timestamp
Open

test_runner: add timestamp to JUnit reporter testsuites#64029
Han5991 wants to merge 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>
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.

test_runner: JUnit reporter omits the timestamp attribute on <testsuite>

2 participants