Title: test_runner: JUnit reporter omits the `timestamp` attribute on `
Open Graph Title: test_runner: JUnit reporter omits the `timestamp` attribute on `
X Title: test_runner: JUnit reporter omits the `timestamp` attribute on `
Description: Problem The JUnit reporter (node --test --test-reporter=junit) emits
Open Graph Description: Problem The JUnit reporter (node --test --test-reporter=junit) emits
X Description: Problem The JUnit reporter (node --test --test-reporter=junit) emits <testsuite> elements without the timestamp attribute defined by the JUnit/Ant XML schema. timestamp records, in ISO 8601, ...
Opengraph URL: https://github.com/nodejs/node/issues/64028
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_runner: JUnit reporter omits the `timestamp` attribute on `\u003ctestsuite\u003e`","articleBody":"### Problem\n\nThe JUnit reporter (`node --test --test-reporter=junit`) emits `\u003ctestsuite\u003e` elements without the `timestamp` attribute defined by the JUnit/Ant XML schema. `timestamp` records, in ISO 8601, when the suite started; Node never writes it.\n\n### Why it matters\n\n`\u003ctestsuite timestamp\u003e` is how JUnit-consuming tools (CI dashboards, test-report viewers) anchor each suite on a time axis — for example, to order suites coming back from parallel/sharded runs, and to build per-suite history and trends across runs. Without it, consumers fall back to file mtime or the overall job time, which is coarser and can be misleading.\n\nNode is also an outlier among JUnit producers: pytest (`--junitxml`), `jest-junit`, `mocha-junit-reporter`, and Maven Surefire all emit `timestamp` on `\u003ctestsuite\u003e`. Node's reporter already emits `time` and `hostname` on `\u003ctestsuite\u003e` (and `file` on `\u003ctestcase\u003e`), but not `timestamp`.\n\n### Current behavior\n\n```console\n$ node --test --test-reporter=junit ...\n\u003ctestsuite name=\"my suite\" time=\"0.42\" disabled=\"0\" errors=\"0\" tests=\"2\" failures=\"0\" skipped=\"0\" hostname=\"...\"\u003e\n```\n\nNo `timestamp` attribute is present.\n\n### Proposed solution\n\nIn `lib/internal/test_runner/reporter/junit.js`, emit the suite start time as the `timestamp` attribute on each `\u003ctestsuite\u003e`.\n\nThere is one open question — the value format:\n\n- **Full ISO 8601 with timezone** (e.g. `2026-06-20T12:34:56.789Z`). This is what `Date.prototype.toISOString()` produces directly, it is unambiguous about the instant, and it is the direction newer tooling (pytest 8.x, Maven Surefire 3.5.5+) is moving.\n- **Legacy no-timezone Ant form** (e.g. `2026-06-20T12:34:56`). This is the canonical de-facto format (Ant `XMLJUnitResultFormatter`; the strict windyroad JUnit XSD even pins it to `\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}` with no zone) and what `jest-junit` / `mocha-junit-reporter` currently emit, but it is ambiguous about the actual instant.","author":{"url":"https://github.com/Han5991","@type":"Person","name":"Han5991"},"datePublished":"2026-06-20T14:06:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/64028/node/issues/64028"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:75f0d827-0037-5f4b-8940-89fd8610e3ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A62A:6D260:AC38C1:EAC242:6A4D5192 |
| html-safe-nonce | 44af7ed59967aebf88461648c0c030165ac2f25e5032cee479b16df9374b7aed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjJBOjZEMjYwOkFDMzhDMTpFQUMyNDI6NkE0RDUxOTIiLCJ2aXNpdG9yX2lkIjoiNzAxNTU2MjUzODg5MjEyMzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7a2c968fd9f8aef39f55d38e3fb9c9200e291bd8dae323e3d4d984366e37845a |
| hovercard-subject-tag | issue:4706944739 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64028/issue_layout |
| twitter:image | https://opengraph.githubassets.com/893d6e8848463d486f264b122b3596466901c0731bf932667842967fcc8ec502/nodejs/node/issues/64028 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/893d6e8848463d486f264b122b3596466901c0731bf932667842967fcc8ec502/nodejs/node/issues/64028 |
| og:image:alt | Problem The JUnit reporter (node --test --test-reporter=junit) emits |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Han5991 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width