-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: run WPT files in parallel again
PR-URL: #47283 Refs: #47146 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
- Loading branch information
Showing
4 changed files
with
87 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
import * as url from 'node:url'; | ||
|
||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); | ||
|
||
const outDir = path.resolve(__dirname, '../out/wpt'); | ||
const files = fs.readdirSync(outDir); | ||
const reports = files.filter((file) => file.endsWith('.json')); | ||
|
||
const startTimes = []; | ||
const endTimes = []; | ||
const results = []; | ||
let runInfo; | ||
|
||
for (const file of reports) { | ||
const report = JSON.parse(fs.readFileSync(path.resolve(outDir, file))); | ||
fs.unlinkSync(path.resolve(outDir, file)); | ||
results.push(...report.results); | ||
startTimes.push(report.time_start); | ||
endTimes.push(report.time_end); | ||
runInfo ||= report.run_info; | ||
} | ||
|
||
const mergedReport = { | ||
time_start: Math.min(...startTimes), | ||
time_end: Math.max(...endTimes), | ||
run_info: runInfo, | ||
results, | ||
}; | ||
|
||
fs.writeFileSync(path.resolve(outDir, 'wptreport.json'), JSON.stringify(mergedReport)); |