test(terminal): keep renderer bench reports separate
This commit is contained in:
@@ -44,5 +44,8 @@ Compare renderer modes with:
|
|||||||
npm run terminal:bench -- --url http://127.0.0.1:3100/rustui/terminal --renderer canvas --browser-executable /usr/bin/google-chrome
|
npm run terminal:bench -- --url http://127.0.0.1:3100/rustui/terminal --renderer canvas --browser-executable /usr/bin/google-chrome
|
||||||
```
|
```
|
||||||
|
|
||||||
It writes `target/terminal-bench/terminal-bench.json` plus screenshots when
|
It writes renderer-specific reports such as
|
||||||
Playwright is available in the workspace.
|
`target/terminal-bench/terminal-bench-webgl.json` and
|
||||||
|
`target/terminal-bench/terminal-bench-canvas.json`, plus
|
||||||
|
`target/terminal-bench/terminal-bench-latest.json` for the most recent run.
|
||||||
|
Screenshots are also named by renderer and viewport.
|
||||||
|
|||||||
@@ -157,8 +157,13 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const report = buildReport(results);
|
const report = buildReport(results);
|
||||||
const reportPath = path.join(options.outputDir, "terminal-bench.json");
|
const reportJson = `${JSON.stringify(report, null, 2)}\n`;
|
||||||
fs.writeFileSync(reportPath, `${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));
|
console.log(JSON.stringify(report, null, 2));
|
||||||
if (!report.passed) {
|
if (!report.passed) {
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
@@ -289,6 +294,10 @@ function benchUrl(options) {
|
|||||||
return url.toString();
|
return url.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function terminalBenchReportPath(options) {
|
||||||
|
return path.join(options.outputDir, `terminal-bench-${options.renderer}.json`);
|
||||||
|
}
|
||||||
|
|
||||||
function browserLaunchOptions(options) {
|
function browserLaunchOptions(options) {
|
||||||
if (options.browserChannel) {
|
if (options.browserChannel) {
|
||||||
return { channel: options.browserChannel };
|
return { channel: options.browserChannel };
|
||||||
|
|||||||
Reference in New Issue
Block a user