fix(runs): disable playwright traces by default, bump to 1.16.1

- default PLAYWRIGHT_TRACE_MODE to off since traces often reach ~10 MB
  per run; traces can still be enabled per run or via the setting
This commit is contained in:
ars9 committed 2026-09-30 18:35:26 +03:00
1 parent ff83b6c7da
commit 84dba6d670
10 files changed
+40 -23

No files matched your search

+16 -7
View File
@@ -111,14 +111,17 @@ describe("ScenarioSchedulerService Playwright traces", () => {
expect(await traceArtifacts(runId)).toHaveLength(0);
});
it("stores the configured default trace mode when none is given", async () => {
const runId = await runScenario("trace-default", "return 1;");
it("stores the configured default trace mode (off) when none is given", async () => {
const runId = await runScenario(
"trace-default",
"throw new Error('boom');",
);
const [row] = await dataSource.query(
`SELECT traceMode FROM scenario_runs WHERE id = ?`,
[runId],
);
expect(row.traceMode).toBe("on");
expect(await traceArtifacts(runId)).toHaveLength(1);
expect(row.traceMode).toBe("off");
expect(await traceArtifacts(runId)).toHaveLength(0);
});
it("falls back to the configured mode for runs without a stored trace mode", async () => {
@@ -128,7 +131,13 @@ describe("ScenarioSchedulerService Playwright traces", () => {
const env = await envRepo.save(
envRepo.create({ name: "trace-null-mode-env", data: {} }),
);
const run = await scenarioService.createRun(sc.id, env.id);
const run = await scenarioService.createRun(
sc.id,
env.id,
false,
TraceMode.On,
);
// Legacy runs have no stored mode; they must use the configured default (off)
await dataSource.query(
`UPDATE scenario_runs SET traceMode = NULL WHERE id = ?`,
[run.id],
@@ -141,7 +150,7 @@ describe("ScenarioSchedulerService Playwright traces", () => {
while (activeRuns.has(run.id) && Date.now() < deadline) {
await new Promise((r) => setTimeout(r, 20));
}
expect(await traceArtifacts(run.id)).toHaveLength(1);
expect(await traceArtifacts(run.id)).toHaveLength(0);
});
describe("HTTP", () => {
@@ -150,7 +159,7 @@ describe("ScenarioSchedulerService Playwright traces", () => {
"/scenarios/run-defaults",
);
expect(res.status).toBe(200);
expect(res.body).toEqual({ traceMode: "on" });
expect(res.body).toEqual({ traceMode: "off" });
});
it("POST /scenarios/:id/run stores the requested trace mode", async () => {