Skip to content

Commit cbbf693

Browse files
committed
ci(repo): add playwright sharding for nextjs integration tests
1 parent 4e7c45d commit cbbf693

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

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

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
integration-tests:
276276
needs: [check-permissions, build-packages]
277277
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
278-
name: Integration Tests (${{ matrix.test-name }}, ${{ matrix.test-project }}${{ matrix.next-version && format(', {0}', matrix.next-version) || '' }})
278+
name: Integration Tests (${{ matrix.test-name }}, ${{ matrix.test-project }}${{ matrix.next-version && format(', {0}', matrix.next-version) || '' }}${{ matrix.shard && format(', shard {0}', matrix.shard) || '' }})
279279
permissions:
280280
contents: read
281281
actions: write # needed for actions/upload-artifact
@@ -315,9 +315,33 @@ jobs:
315315
- test-name: "nextjs"
316316
test-project: "chrome"
317317
next-version: "15"
318+
shard: "1/3"
319+
shard-label: "1-of-3"
320+
- test-name: "nextjs"
321+
test-project: "chrome"
322+
next-version: "15"
323+
shard: "2/3"
324+
shard-label: "2-of-3"
325+
- test-name: "nextjs"
326+
test-project: "chrome"
327+
next-version: "15"
328+
shard: "3/3"
329+
shard-label: "3-of-3"
330+
- test-name: "nextjs"
331+
test-project: "chrome"
332+
next-version: "16"
333+
shard: "1/3"
334+
shard-label: "1-of-3"
335+
- test-name: "nextjs"
336+
test-project: "chrome"
337+
next-version: "16"
338+
shard: "2/3"
339+
shard-label: "2-of-3"
318340
- test-name: "nextjs"
319341
test-project: "chrome"
320342
next-version: "16"
343+
shard: "3/3"
344+
shard-label: "3-of-3"
321345
- test-name: "quickstart"
322346
test-project: "chrome"
323347
next-version: "15"
@@ -365,6 +389,7 @@ jobs:
365389
E2E_NEXTJS_VERSION: ${{ matrix.next-version }}
366390
E2E_PROJECT: ${{ matrix.test-project }}
367391
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
392+
PLAYWRIGHT_SHARD: ${{ matrix.shard || '' }}
368393
run: |
369394
# Use turbo's built-in --affected flag to detect changes
370395
# This automatically uses GITHUB_BASE_REF in GitHub Actions
@@ -449,13 +474,14 @@ jobs:
449474
E2E_CLERK_ENCRYPTION_KEY: ${{ matrix.clerk-encryption-key }}
450475
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
451476
NODE_EXTRA_CA_CERTS: ${{ github.workspace }}/integration/certs/rootCA.pem
477+
PLAYWRIGHT_SHARD: ${{ matrix.shard || '' }}
452478
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
453479

454480
- name: Upload test-results
455481
if: ${{ cancelled() || failure() }}
456482
uses: actions/upload-artifact@v4
457483
with:
458-
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }}
484+
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }}${{ matrix.shard-label && format('-shard-%s', matrix.shard-label) || '' }}
459485
path: integration/test-results
460486
retention-days: 1
461487

turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
"outputLogs": "new-only"
223223
},
224224
"//#test:integration:nextjs": {
225-
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"],
225+
"env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS", "PLAYWRIGHT_SHARD"],
226226
"inputs": ["integration/**"],
227227
"outputLogs": "new-only"
228228
},

0 commit comments

Comments
 (0)