From 98cdd4d3aa32ae1f9d37771bb0d11f2ced531a7f Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 8 Apr 2026 13:57:08 +0200 Subject: [PATCH 1/2] test: ensure WPT report is in out/wpt Signed-off-by: Filip Skokan --- test/common/wpt.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index b7c268649a5477..f05bf6ff56942c 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -95,6 +95,8 @@ class ReportResult { class WPTReport { constructor(path) { this.filename = `report-${path.replaceAll('/', '-')}.json`; + // Resolve at construction time so cwd changes (e.g. tmpdir cleanup) don't affect the output path. + this.filepath = path.resolve('out', 'wpt', this.filename); /** @type {Map} */ this.results = new Map(); this.time_start = Date.now(); @@ -139,7 +141,7 @@ class WPTReport { os: getOs(), }; - fs.writeFileSync(`out/wpt/${this.filename}`, JSON.stringify({ + fs.writeFileSync(this.filepath, JSON.stringify({ time_start: this.time_start, time_end: this.time_end, run_info: this.run_info, From 42990acabcd7a03137b0ca1d69b5ed6cc2351bec Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 8 Apr 2026 17:04:33 +0200 Subject: [PATCH 2/2] fixup! test: ensure WPT report is in out/wpt --- test/common/wpt.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index f05bf6ff56942c..0ca47d1917a43b 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -93,10 +93,9 @@ class ReportResult { // Checkout https://github.com/web-platform-tests/wpt.fyi/tree/main/api#results-creation // for more details. class WPTReport { - constructor(path) { - this.filename = `report-${path.replaceAll('/', '-')}.json`; - // Resolve at construction time so cwd changes (e.g. tmpdir cleanup) don't affect the output path. - this.filepath = path.resolve('out', 'wpt', this.filename); + constructor(testPath) { + this.filename = `report-${testPath.replaceAll('/', '-')}.json`; + this.filepath = path.join(__dirname, `../../out/wpt/${this.filename}`); /** @type {Map} */ this.results = new Map(); this.time_start = Date.now();