forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
45 lines (44 loc) · 1.59 KB
/
Copy pathplaywright.config.ts
File metadata and controls
45 lines (44 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests/e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
// Local default of 1 retry covers the `agent_framework.Agent` concurrency
// flake: the shared Agent instance + single OpenAI HTTP client serialise
// SSE streams under high worker counts, so a handful of cells time out at
// 30s on the first attempt and pass cleanly on retry. CI keeps 2 retries
// as the safer ratchet. The underlying upstream fix is per-request agent
// instantiation; see the D5 sweep doc in Notion.
retries: process.env.CI ? 2 : 1,
// Local default of 4 workers caps the SSE concurrency the python agent has
// to absorb. The reused `agent_framework.Agent` + shared OpenAI HTTP client
// serialise concurrent streams; >4 workers makes 30s test timeouts inevitable
// for a few cells. 4 keeps things parallel without overloading the agent.
workers: process.env.CI ? 1 : 4,
reporter: "html",
use: {
baseURL: process.env.BASE_URL || "http://localhost:3000",
trace: "on-first-retry",
extraHTTPHeaders: {
"X-AIMock-Context": "ms-agent-python",
},
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: process.env.CI
? undefined
: {
command: "pnpm dev",
url: "http://localhost:3000",
reuseExistingServer: true,
env: {
...process.env,
OPENAI_BASE_URL: process.env.OPENAI_BASE_URL || "",
OPENAI_API_KEY: process.env.OPENAI_API_KEY || "",
},
},
});