Skip to content

Commit 94dbade

Browse files
committed
Change Windows to use max 4 workers for end-to-end tests
1 parent 0565292 commit 94dbade

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

application/shared-webapp/tests/e2e/playwright.config.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
/// <reference types="node" />
22
import { defineConfig, devices } from "@playwright/test";
3-
import { getBaseUrl } from "./utils/constants";
3+
import { getBaseUrl, isWindows } from "./utils/constants";
4+
5+
let workers: number | undefined;
6+
if (process.env.CI) {
7+
workers = 1; // Limit to 1 worker on CI
8+
} else if (isWindows) {
9+
workers = 4; // Limit to 4 workers on Windows to avoid performance issues
10+
} else {
11+
workers = undefined; // On non-Windows systems, use all available CPUs
12+
}
413

514
/**
615
* See https://playwright.dev/docs/test-configuration.
@@ -16,7 +25,8 @@ export default defineConfig({
1625
retries: process.env.CI ? 2 : 0,
1726

1827
// Opt out of parallel tests on CI.
19-
workers: process.env.CI ? 1 : undefined,
28+
29+
workers: workers,
2030

2131
// Reporter to use. See https://playwright.dev/docs/test-reporters
2232
reporter: process.env.CI ? "github" : [["list"], ["html", { open: "never" }]],

application/shared-webapp/tests/e2e/utils/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
const DEFAULT_BASE_URL = "https://localhost:9000";
88

9+
export const isWindows = process.platform === "win32";
10+
911
/**
1012
* Get the base URL for tests
1113
*/

0 commit comments

Comments
 (0)