test(terminal): keep renderer bench reports separate
This commit is contained in:
@@ -157,8 +157,13 @@ async function main() {
|
||||
}
|
||||
|
||||
const report = buildReport(results);
|
||||
const reportPath = path.join(options.outputDir, "terminal-bench.json");
|
||||
fs.writeFileSync(reportPath, `${JSON.stringify(report, null, 2)}\n`);
|
||||
const reportJson = `${JSON.stringify(report, null, 2)}\n`;
|
||||
const reportPath = terminalBenchReportPath(options);
|
||||
const latestReportPath = path.join(options.outputDir, "terminal-bench-latest.json");
|
||||
fs.writeFileSync(reportPath, reportJson);
|
||||
fs.writeFileSync(latestReportPath, reportJson);
|
||||
console.error(`[terminal-bench] wrote ${reportPath}`);
|
||||
console.error(`[terminal-bench] wrote ${latestReportPath}`);
|
||||
console.log(JSON.stringify(report, null, 2));
|
||||
if (!report.passed) {
|
||||
process.exitCode = 1;
|
||||
@@ -289,6 +294,10 @@ function benchUrl(options) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
function terminalBenchReportPath(options) {
|
||||
return path.join(options.outputDir, `terminal-bench-${options.renderer}.json`);
|
||||
}
|
||||
|
||||
function browserLaunchOptions(options) {
|
||||
if (options.browserChannel) {
|
||||
return { channel: options.browserChannel };
|
||||
|
||||
Reference in New Issue
Block a user