From 779e1152b0078ebe352aeaea04efad0f15ccf70a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 6 Mar 2023 11:45:48 +0100 Subject: [PATCH 1/3] test: Run playwright tests in parallel --- packages/integration-tests/playwright.config.ts | 2 +- .../replay/privacyDefault/test.ts-snapshots/privacy.json | 5 ++--- packages/nextjs/playwright.config.ts | 2 +- packages/remix/playwright.config.ts | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/integration-tests/playwright.config.ts b/packages/integration-tests/playwright.config.ts index 0b1a4e15bfee..6e6e86e71e66 100644 --- a/packages/integration-tests/playwright.config.ts +++ b/packages/integration-tests/playwright.config.ts @@ -2,6 +2,6 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { retries: 0, - workers: 3, + fullyParallel: true, }; export default config; diff --git a/packages/integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy.json b/packages/integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy.json index f31f8b967d12..11bf6d7a7fa7 100644 --- a/packages/integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy.json +++ b/packages/integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy.json @@ -32,9 +32,8 @@ "type": 2, "tagName": "link", "attributes": { - "rel": "icon", - "type": "image/png", - "href": "file://assets/icon/favicon.png" + "rr_width": "[0-50]px", + "rr_height": "[0-50]px" }, "childNodes": [], "id": 6 diff --git a/packages/nextjs/playwright.config.ts b/packages/nextjs/playwright.config.ts index 945e7e508954..407cb4e96976 100644 --- a/packages/nextjs/playwright.config.ts +++ b/packages/nextjs/playwright.config.ts @@ -6,7 +6,7 @@ const config: PlaywrightTestConfig = { use: { baseURL: 'http://localhost:3000', }, - workers: 3, + fullyParallel: true, webServer: { cwd: path.join(__dirname, 'test', 'integration'), command: 'yarn start', diff --git a/packages/remix/playwright.config.ts b/packages/remix/playwright.config.ts index 0e609bb2efa5..6dec8b8dd481 100644 --- a/packages/remix/playwright.config.ts +++ b/packages/remix/playwright.config.ts @@ -5,7 +5,7 @@ const config: PlaywrightTestConfig = { use: { baseURL: 'http://localhost:3000', }, - workers: 3, + fullyParallel: true, webServer: { command: '(cd test/integration/ && yarn build && yarn start)', port: 3000, From 379f59e262890d651ce9b21e318c3ae5ed1a6807 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 6 Mar 2023 11:53:59 +0100 Subject: [PATCH 2/3] use 5 workers on CI --- packages/integration-tests/playwright.config.ts | 3 +++ packages/nextjs/playwright.config.ts | 3 +++ packages/remix/playwright.config.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/packages/integration-tests/playwright.config.ts b/packages/integration-tests/playwright.config.ts index 6e6e86e71e66..d767e39491db 100644 --- a/packages/integration-tests/playwright.config.ts +++ b/packages/integration-tests/playwright.config.ts @@ -2,6 +2,9 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { retries: 0, + // Run tests inside of a single file in parallel fullyParallel: true, + // Use 5 workers on CI, else use defaults (based on available CPU cores) + workers: process.env.CI ? 5 : undefined, }; export default config; diff --git a/packages/nextjs/playwright.config.ts b/packages/nextjs/playwright.config.ts index 407cb4e96976..4bd2e11e6471 100644 --- a/packages/nextjs/playwright.config.ts +++ b/packages/nextjs/playwright.config.ts @@ -6,7 +6,10 @@ const config: PlaywrightTestConfig = { use: { baseURL: 'http://localhost:3000', }, + // Run tests inside of a single file in parallel fullyParallel: true, + // Use 5 workers on CI, else use defaults (based on available CPU cores) + workers: process.env.CI ? 5 : undefined, webServer: { cwd: path.join(__dirname, 'test', 'integration'), command: 'yarn start', diff --git a/packages/remix/playwright.config.ts b/packages/remix/playwright.config.ts index 6dec8b8dd481..96009636a05c 100644 --- a/packages/remix/playwright.config.ts +++ b/packages/remix/playwright.config.ts @@ -5,7 +5,10 @@ const config: PlaywrightTestConfig = { use: { baseURL: 'http://localhost:3000', }, + // Run tests inside of a single file in parallel fullyParallel: true, + // Use 5 workers on CI, else use defaults (based on available CPU cores) + workers: process.env.CI ? 5 : undefined, webServer: { command: '(cd test/integration/ && yarn build && yarn start)', port: 3000, From 5ef5321f395bfd3d56adcfa63ee0af6a64c5e170 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 6 Mar 2023 12:52:38 +0100 Subject: [PATCH 3/3] add better comment --- packages/integration-tests/playwright.config.ts | 1 + packages/nextjs/playwright.config.ts | 1 + packages/remix/playwright.config.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/integration-tests/playwright.config.ts b/packages/integration-tests/playwright.config.ts index d767e39491db..7445d985c1ba 100644 --- a/packages/integration-tests/playwright.config.ts +++ b/packages/integration-tests/playwright.config.ts @@ -5,6 +5,7 @@ const config: PlaywrightTestConfig = { // Run tests inside of a single file in parallel fullyParallel: true, // Use 5 workers on CI, else use defaults (based on available CPU cores) + // Note that 5 is a random number selected to work well with our CI setup workers: process.env.CI ? 5 : undefined, }; export default config; diff --git a/packages/nextjs/playwright.config.ts b/packages/nextjs/playwright.config.ts index 4bd2e11e6471..d0cf5c2fa767 100644 --- a/packages/nextjs/playwright.config.ts +++ b/packages/nextjs/playwright.config.ts @@ -9,6 +9,7 @@ const config: PlaywrightTestConfig = { // Run tests inside of a single file in parallel fullyParallel: true, // Use 5 workers on CI, else use defaults (based on available CPU cores) + // Note that 5 is a random number selected to work well with our CI setup workers: process.env.CI ? 5 : undefined, webServer: { cwd: path.join(__dirname, 'test', 'integration'), diff --git a/packages/remix/playwright.config.ts b/packages/remix/playwright.config.ts index 96009636a05c..88ba7b451389 100644 --- a/packages/remix/playwright.config.ts +++ b/packages/remix/playwright.config.ts @@ -8,6 +8,7 @@ const config: PlaywrightTestConfig = { // Run tests inside of a single file in parallel fullyParallel: true, // Use 5 workers on CI, else use defaults (based on available CPU cores) + // Note that 5 is a random number selected to work well with our CI setup workers: process.env.CI ? 5 : undefined, webServer: { command: '(cd test/integration/ && yarn build && yarn start)',