Skip to content

Commit 04103cf

Browse files
hi-ogawaOpenCode
andcommitted
refactor: isolate browser benchmark suite
Co-authored-by: OpenCode <noreply@opencode.ai>
1 parent eab6345 commit 04103cf

4 files changed

Lines changed: 29 additions & 3 deletions

File tree

packages/app/e2e/benchmark.spec.ts renamed to packages/app/benchmark/e2e/benchmark.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { existsSync } from "node:fs";
22
import { writeFile } from "node:fs/promises";
33
import { resolve } from "node:path";
44
import { expect, test } from "@playwright/test";
5-
import type { BenchmarkResult } from "../src/app";
5+
import type { BenchmarkResult } from "../../src/app";
66

7-
const root = resolve(import.meta.dirname, "../../..");
7+
const root = resolve(import.meta.dirname, "../../../..");
88
const model = resolve(root, "data/onnx-lean/htdemucs.onnx");
99
const dft = resolve(root, "data/onnx-lean/dft.bin");
1010
const fixture = resolve(root, "data/benchmark/input-30s.wav");
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { defineConfig, devices } from "@playwright/test";
2+
3+
export default defineConfig({
4+
testDir: "./e2e",
5+
fullyParallel: false,
6+
workers: 1,
7+
retries: 0,
8+
reporter: "list",
9+
timeout: 60 * 60_000,
10+
use: { baseURL: "http://localhost:5199" },
11+
webServer: {
12+
command: "pnpm dev --port 5199 --strictPort",
13+
url: "http://localhost:5199",
14+
reuseExistingServer: false,
15+
},
16+
projects: [
17+
{
18+
name: "chromium",
19+
use: {
20+
...devices["Desktop Chrome"],
21+
channel: "chromium",
22+
},
23+
},
24+
],
25+
});

packages/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dev": "vite",
77
"build": "vite build",
88
"test-e2e": "playwright test",
9+
"benchmark": "playwright test --config benchmark/playwright.config.ts",
910
"wasm-separate": "tsx src/node/cli.ts separate"
1011
},
1112
"dependencies": {

tools/benchmark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async function main() {
7777

7878
await exec(
7979
"pnpm",
80-
["-C", "packages/app", "playwright", "test", "e2e/benchmark.spec.ts"],
80+
["-C", "packages/app", "benchmark"],
8181
{ cwd: root, maxBuffer: 10 * 1024 * 1024 },
8282
);
8383
const webRuns = (

0 commit comments

Comments
 (0)