Skip to content

Commit 3a7c9f3

Browse files
authored
ci: run e2e tests using turbopack (#16237)
This PR changes our CI to run templates using turbo instead of webpack. Turbo is now used for both build and dev in our templates, meaning ensuring compatibility with turbopack through our tests is more important than ensuring compatibility with webpack. --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1214013522421653
1 parent 5f5694f commit 3a7c9f3

File tree

1 file changed

+1
-149
lines changed

1 file changed

+1
-149
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ jobs:
389389
#
390390
# Note: The e2e-prep job runs prepare-run-test-against-prod:ci once and caches the result.
391391
# This job restores that cache, so we use test:e2e:prod:run which skips preparation.
392-
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}_${{ matrix.shard }}.json pnpm test:e2e:prod:run:noturbo ${{ matrix.suite }} --shard=${{ matrix.shard }}/${{ matrix.total-shards }} --fully-parallel${{ matrix.parallel == false && ' --workers=1' || '' }}
392+
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}_${{ matrix.shard }}.json pnpm test:e2e:prod:run ${{ matrix.suite }} --shard=${{ matrix.shard }}/${{ matrix.total-shards }} --fully-parallel${{ matrix.parallel == false && ' --workers=1' || '' }}
393393
env:
394394
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}_${{ matrix.shard }}.json
395395
NEXT_TELEMETRY_DISABLED: 1
@@ -409,154 +409,6 @@ jobs:
409409
# report-tag: ${{ matrix.suite }}
410410
# job-summary: true
411411

412-
# This is unused, keeping it here for reference and possibly enabling in the future
413-
tests-e2e-turbo:
414-
runs-on: ubuntu-24.04
415-
needs: [changes, build]
416-
if: >-
417-
needs.changes.outputs.needs_tests == 'true' &&
418-
(
419-
contains(github.event.pull_request.labels.*.name, 'run-e2e-turbo') ||
420-
github.event.label.name == 'run-e2e-turbo'
421-
)
422-
name: e2e-turbo-${{ matrix.suite }}
423-
strategy:
424-
fail-fast: false
425-
matrix:
426-
# find test -type f -name 'e2e.spec.ts' | sort | xargs dirname | xargs -I {} basename {}
427-
suite:
428-
- _community
429-
- access-control
430-
- admin__e2e__general
431-
- admin__e2e__list-view
432-
- admin__e2e__document-view
433-
- admin-bar
434-
- admin-root
435-
- auth
436-
- auth-basic
437-
- bulk-edit
438-
- dashboard
439-
- joins
440-
- field-error-states
441-
- fields-relationship
442-
- fields__collections__Array
443-
- fields__collections__Blocks
444-
- fields__collections__Blocks#config.blockreferences.ts
445-
- fields__collections__Checkbox
446-
- fields__collections__Collapsible
447-
- fields__collections__ConditionalLogic
448-
- fields__collections__CustomID
449-
- fields__collections__Date
450-
- fields__collections__Email
451-
- fields__collections__Indexed
452-
- fields__collections__JSON
453-
- fields__collections__Number
454-
- fields__collections__Point
455-
- fields__collections__Radio
456-
- fields__collections__Relationship
457-
- fields__collections__Row
458-
- fields__collections__Select
459-
- fields__collections__Tabs
460-
- fields__collections__Tabs2
461-
- fields__collections__Text
462-
- fields__collections__UI
463-
- fields__collections__Upload
464-
- group-by
465-
- folders
466-
- hooks
467-
- lexical__collections___LexicalFullyFeatured
468-
- lexical__collections___LexicalFullyFeatured__db
469-
- lexical__collections__LexicalHeadingFeature
470-
- lexical__collections__LexicalJSXConverter
471-
- lexical__collections__LexicalLinkFeature
472-
- lexical__collections__OnDemandForm
473-
- lexical__collections__Lexical__e2e__main
474-
- lexical__collections__Lexical__e2e__blocks
475-
- lexical__collections__Lexical__e2e__blocks#config.blockreferences.ts
476-
- lexical__collections__RichText
477-
- query-presets
478-
- form-state
479-
- live-preview
480-
- localization
481-
- locked-documents
482-
- i18n
483-
- plugin-cloud-storage
484-
- plugin-form-builder
485-
- plugin-import-export
486-
- plugin-multi-tenant
487-
- plugin-nested-docs
488-
- plugin-seo
489-
- queues
490-
- sort
491-
- trash
492-
- versions
493-
- uploads
494-
env:
495-
SUITE_NAME: ${{ matrix.suite }}
496-
steps:
497-
- uses: actions/checkout@v5
498-
499-
- name: Node setup
500-
uses: ./.github/actions/setup
501-
with:
502-
pnpm-run-install: false
503-
pnpm-restore-cache: false # Full build is restored below
504-
cache-propagation-delay: 120 # https://github.com/actions/cache/issues/1710
505-
506-
- name: Restore build
507-
uses: actions/cache@v4
508-
with:
509-
path: ./*
510-
key: ${{ github.sha }}
511-
fail-on-cache-miss: true
512-
513-
- name: Start LocalStack
514-
run: pnpm docker:start
515-
if: contains(fromJson('["plugin-cloud-storage", "plugin-import-export"]'), matrix.suite) || contains(matrix.suite, 'storage-s3__client-uploads') || contains(matrix.suite, 'storage-vercel-blob__client-uploads')
516-
517-
- name: Store Playwright's Version
518-
run: |
519-
# Extract the version number using a more targeted regex pattern with awk
520-
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --depth=0 | awk '/@playwright\/test/ {print $2}')
521-
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
522-
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
523-
524-
- name: Cache Playwright Browsers for Playwright's Version
525-
id: cache-playwright-browsers
526-
uses: actions/cache@v4
527-
with:
528-
path: ~/.cache/ms-playwright
529-
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
530-
531-
- name: Setup Playwright - Browsers and Dependencies
532-
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
533-
run: pnpm exec playwright install --with-deps chromium
534-
535-
- name: Setup Playwright - Dependencies-only
536-
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
537-
run: pnpm exec playwright install-deps chromium
538-
539-
- name: E2E Tests
540-
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci ${{ matrix.suite }}
541-
env:
542-
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}.json
543-
NEXT_TELEMETRY_DISABLED: 1
544-
545-
- uses: actions/upload-artifact@v4
546-
if: always()
547-
with:
548-
name: test-results-turbo${{ matrix.suite }}
549-
path: test/test-results/
550-
if-no-files-found: ignore
551-
retention-days: 1
552-
553-
# Disabled until this is fixed: https://github.com/daun/playwright-report-summary/issues/156
554-
# - uses: daun/playwright-report-summary@v3
555-
# with:
556-
# report-file: results_${{ matrix.suite }}.json
557-
# report-tag: ${{ matrix.suite }}
558-
# job-summary: true
559-
560412
# Build listed templates with packed local packages and then runs their int and e2e tests
561413
build-and-test-templates:
562414
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)