ci: Increase Playwright test parallelism (#18484)

This commit is contained in:
shortstacked
2025-08-19 09:13:05 +01:00
committed by GitHub
parent 3386047321
commit e87395304d
15 changed files with 251 additions and 96 deletions

View File

@@ -2,6 +2,7 @@
import { currentsReporter } from '@currents/playwright';
import { defineConfig } from '@playwright/test';
import os from 'os';
import path from 'path';
import currentsConfig from './currents.config';
import { getProjects } from './playwright-projects';
@@ -11,6 +12,7 @@ const IS_CI = !!process.env.CI;
const MACBOOK_WINDOW_SIZE = { width: 1536, height: 960 };
const USER_FOLDER = path.join(os.tmpdir(), `n8n-main-${Date.now()}`);
// Calculate workers based on environment
// The amount of workers to run, limited to 6 as higher causes instability in the local server
// Use half the CPUs in local, full in CI (CI has no other processes so we can use more)
@@ -31,10 +33,18 @@ export default defineConfig({
// We use this if an n8n url is passed in. If the server is already running, we reuse it.
webServer: process.env.N8N_BASE_URL
? {
command: `cd .. && N8N_PORT=${getPortFromUrl(process.env.N8N_BASE_URL)} N8N_USER_FOLDER=/${os.tmpdir()}/n8n-main-$(date +%s) E2E_TESTS=true pnpm start`,
command: 'cd .. && pnpm start',
url: `${process.env.N8N_BASE_URL}/favicon.ico`,
timeout: 20000,
reuseExistingServer: true,
env: {
DB_SQLITE_POOL_SIZE: '40',
E2E_TESTS: 'true',
N8N_PORT: getPortFromUrl(process.env.N8N_BASE_URL),
N8N_USER_FOLDER: USER_FOLDER,
N8N_LOG_LEVEL: 'debug',
N8N_METRICS: 'true',
},
}
: undefined,