From 4c63c78e294ced1d5dcadd85a0a30f3b058997ae Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Mon, 31 Jul 2023 09:55:32 -0700 Subject: [PATCH] test(turbopack): run daily with --experimental --- .github/workflows/nextjs-integration-test.yml | 20 +++++++++---------- .github/workflows/setup-nextjs-build.yml | 10 ++++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/nextjs-integration-test.yml b/.github/workflows/nextjs-integration-test.yml index 0167339c405387..ded00727158e4d 100644 --- a/.github/workflows/nextjs-integration-test.yml +++ b/.github/workflows/nextjs-integration-test.yml @@ -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 @@ -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 @@ -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) @@ -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 @@ -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 @@ -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) @@ -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 @@ -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. diff --git a/.github/workflows/setup-nextjs-build.yml b/.github/workflows/setup-nextjs-build.yml index 46ab3d9cd64120..bc5eb9bbe5ae75 100644 --- a/.github/workflows/setup-nextjs-build.yml +++ b/.github/workflows/setup-nextjs-build.yml @@ -88,19 +88,21 @@ 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 "built='pass'" >> $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.built != 'pass' }} run: | + echo ${{ steps.build-next-swc-turbopack-patch.outputs.built }} + echo ${{ steps.build-next-swc-turbopack-patch.outputs.built != 'pass' }} + echo ${{ steps.build-next-swc-turbopack-patch.outputs.built == 'pass' }} 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"