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

@@ -30,7 +30,7 @@ on:
containers:
description: 'Number of containers to run tests in.'
required: false
default: '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]'
default: '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]'
type: string
pr_number:
description: 'PR number to run tests for.'

View File

@@ -11,7 +11,7 @@ on:
shards:
description: 'Shards for parallel execution'
required: false
default: '[1]'
default: '[1, 2]'
type: string
docker-image:
description: 'Docker image to use (for docker-pull mode)'
@@ -28,6 +28,7 @@ env:
NODE_OPTIONS: --max-old-space-size=3072
# Disable Ryuk to avoid issues with Docker since it needs privileged access, containers are cleaned on teardown anyway
TESTCONTAINERS_RYUK_DISABLED: true
PLAYWRIGHT_WORKERS: 3 # We have 2 CPUs on this runner but we can use more workers since it's low CPU intensive
jobs:
test:
@@ -35,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
shard: ${{ fromJSON(inputs.shards || '[1]') }}
shard: ${{ fromJSON(inputs.shards || '[1, 2]') }}
name: Test (Shard ${{ matrix.shard }}/${{ strategy.job-total }})
steps:
@@ -61,7 +62,7 @@ jobs:
run: |
pnpm --filter=n8n-playwright test:local \
--shard=${{ matrix.shard }}/${{ strategy.job-total }} \
--workers=2
--workers=${{ env.PLAYWRIGHT_WORKERS }}
env:
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
@@ -70,7 +71,7 @@ jobs:
run: |
pnpm --filter=n8n-playwright test:container:standard \
--shard=${{ matrix.shard }}/${{ strategy.job-total }} \
--workers=2
--workers=${{ env.PLAYWRIGHT_WORKERS }}
env:
N8N_DOCKER_IMAGE: ${{ inputs.test-mode == 'docker-build' && 'n8nio/n8n:local' || inputs.docker-image }}
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}