Skip to content

Commit

Permalink
test(turbopack): run daily with --experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jul 31, 2023
1 parent 6e2be01 commit 13cf01c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/nextjs-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ env:
DATADOG_TRACE_NEXTJS_TEST: "true"
DD_ENV: "ci"
# Turbopack specific customization for the test runner
TURBOPACK: 1
EXPERIMENTAL_TURBOPACK: 1
__INTERNAL_CUSTOM_TURBOPACK_BINDINGS: ${{ github.workspace }}/packages/next-swc/native/next-swc.linux-x64-gnu.node
NEXT_TEST_SKIP_RETRY_MANIFEST: ${{ github.workspace }}/integration-test-data/test-results/main/failed-test-path-list.json
NEXT_TEST_CONTINUE_ON_ERROR: TRUE
Expand Down Expand Up @@ -78,8 +78,7 @@ jobs:
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
NEXT_TEST_MODE=dev node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(development|e2e|unit)/.*\.test\.(js|jsx|ts|tsx)$'
ls test
NEXT_TEST_MODE=dev node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/(development|e2e|unit)|packages\/.*\/src\/.*)/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
# It is currently expected to fail some of next.js integration test, do not fail CI check.
continue-on-error: true
Expand All @@ -92,7 +91,6 @@ jobs:
name: Test trace reports
path: |
test/turbopack-test-junit-report
if-no-files-found: ignore
test-prod:
name: Next.js integration test (Production)
Expand All @@ -102,7 +100,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [1, 2, 3]
group: [1, 2, 3, 4, 5]

steps:
- uses: actions/cache/restore@v3
Expand All @@ -116,7 +114,8 @@ jobs:
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
NEXT_TEST_MODE=start node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(production|e2e)/.*\.test\.(js|jsx|ts|tsx)$'
NEXT_TEST_MODE=start node run-tests.js -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/(production|e2e))/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
continue-on-error: true
env:
NEXT_INTEGRATION_TEST: true
Expand All @@ -126,7 +125,6 @@ jobs:
name: Test trace reports
path: |
test/turbopack-test-junit-report
if-no-files-found: ignore
test-integration:
name: Next.js integration test (Integration)
Expand All @@ -136,7 +134,7 @@ jobs:
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]

steps:
- uses: actions/cache/restore@v3
Expand All @@ -150,17 +148,17 @@ jobs:
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
node run-tests.js -g ${{ matrix.group }}/6 -c ${TEST_CONCURRENCY} --test-pattern '^(integration)/.*\.test\.(js|jsx|ts|tsx)$'
node run-tests.js -g ${{ matrix.group }}/12 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/integration)/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
continue-on-error: true
env:
NEXT_INTEGRATION_TEST: true
- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
name: Test trace reports
name: Upload test trace reports
path: |
test/turbopack-test-junit-report
if-no-files-found: ignore
# Collect integration test results from execute_tests,
# Store it as github artifact for next step to consume.
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/setup-nextjs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,20 @@ jobs:
# Basic recipe to apply patch to cargo via cli looks like this:
# cargo check --config 'patch."https://github.com/vercel/turbo".$PKG_NAME.git="https://github.com/vercel/turbo.git?rev=$SHA"'
# Careful to preserve quote to allow dot expression can access git url based property key.
export BINDING=$(printf 'patch.\\"%s\\".%s.git=\\"%s?rev=%s\\"' "$TURBOPACK_REMOTE" "turbo-binding" "$TURBOPACK_REMOTE" "$GITHUB_SHA")
export BINDING=$(printf 'patch.\\"%s\\".%s.git=\\"%s?rev=%s\\"' "$TURBOPACK_REMOTE" "turbopack-binding" "$TURBOPACK_REMOTE" "$GITHUB_SHA")
export TASKS=$(printf 'patch.\\"%s\\".%s.git=\\"%s?rev=%s\\"' "$TURBOPACK_REMOTE" "turbo-tasks" "$TURBOPACK_REMOTE" "$GITHUB_SHA")
export TASKS_FS=$(printf 'patch.\\"%s\\".%s.git=\\"%s?rev=%s\\"' "$TURBOPACK_REMOTE" "turbo-tasks-fs" "$TURBOPACK_REMOTE" "$GITHUB_SHA")
echo "Trying to build next-swc with turbopack $GITHUB_SHA"
echo "success=false" >> $GITHUB_OUTPUT
hyperfine --min-runs 1 --show-output 'pnpm run --filter=@next/swc build-native --features plugin,rustls-tls --release --cargo-flags="--config $BINDING --config $TASKS --config $TASKS_FS"'
echo "success=true" >> $GITHUB_OUTPUT
echo "success='true'" >> $GITHUB_OUTPUT
echo "Successfully built next-swc with turbopack $GITHUB_SHA"
- name: Build next-swc
if: steps.build-next-swc-turbopack-patch.outputs.success != true
if: steps.build-next-swc-turbopack-patch.outputs.success != 'true'
run: |
echo ${{ steps.build-next-swc-turbopack-patch.outputs.success }}
echo ${{ steps.build-next-swc-turbopack-patch.outputs.success }} != 'true'
echo "Looks like we could not apply latest turbopack to next-swc. Trying to build next-swc with published turbopack. This might happen when there is a breaking changes in turbopack, and next.js is not yet updated."
hyperfine --min-runs 1 --show-output 'pnpm run --filter=@next/swc build-native --features plugin,rustls-tls --release'
echo "Successfully built next-swc with published turbopack"
Expand Down

0 comments on commit 13cf01c

Please sign in to comment.