fix(junit): use the JUnit schema's specified ISO format for timestamp (#21062)

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
Leo Sklyut 2023-02-27 05:04:22 -05:00 committed by GitHub
parent 4d91248c1e
commit 6c3d35fa58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ import { assert } from 'playwright-core/lib/utils';
class JUnitReporter implements Reporter {
private config!: FullConfig;
private suite!: Suite;
private timestamp!: number;
private timestamp!: Date;
private startTime!: number;
private totalTests = 0;
private totalFailures = 0;
@ -51,7 +51,7 @@ class JUnitReporter implements Reporter {
onBegin(config: FullConfig, suite: Suite) {
this.config = config;
this.suite = suite;
this.timestamp = Date.now();
this.timestamp = new Date();
this.startTime = monotonicTime();
}
@ -116,7 +116,7 @@ class JUnitReporter implements Reporter {
name: 'testsuite',
attributes: {
name: suite.title,
timestamp: this.timestamp,
timestamp: this.timestamp.toISOString(),
hostname: projectName,
tests,
failures,