mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
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:
parent
4d91248c1e
commit
6c3d35fa58
@ -24,7 +24,7 @@ import { assert } from 'playwright-core/lib/utils';
|
|||||||
class JUnitReporter implements Reporter {
|
class JUnitReporter implements Reporter {
|
||||||
private config!: FullConfig;
|
private config!: FullConfig;
|
||||||
private suite!: Suite;
|
private suite!: Suite;
|
||||||
private timestamp!: number;
|
private timestamp!: Date;
|
||||||
private startTime!: number;
|
private startTime!: number;
|
||||||
private totalTests = 0;
|
private totalTests = 0;
|
||||||
private totalFailures = 0;
|
private totalFailures = 0;
|
||||||
@ -51,7 +51,7 @@ class JUnitReporter implements Reporter {
|
|||||||
onBegin(config: FullConfig, suite: Suite) {
|
onBegin(config: FullConfig, suite: Suite) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.suite = suite;
|
this.suite = suite;
|
||||||
this.timestamp = Date.now();
|
this.timestamp = new Date();
|
||||||
this.startTime = monotonicTime();
|
this.startTime = monotonicTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ class JUnitReporter implements Reporter {
|
|||||||
name: 'testsuite',
|
name: 'testsuite',
|
||||||
attributes: {
|
attributes: {
|
||||||
name: suite.title,
|
name: suite.title,
|
||||||
timestamp: this.timestamp,
|
timestamp: this.timestamp.toISOString(),
|
||||||
hostname: projectName,
|
hostname: projectName,
|
||||||
tests,
|
tests,
|
||||||
failures,
|
failures,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user