Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(turbopack): run daily with --experimental #5648

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 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 Expand Up @@ -208,7 +206,7 @@ jobs:
- name: Upload test trace to datadog
continue-on-error: true
run: |
npm install -g junit-report-merger@6.0.2 @datadog/datadog-ci@2.14.0
npm install -g junit-report-merger@6.0.2 @datadog/datadog-ci @aws-sdk/property-provider
jrm ./nextjs-test-result-junit.xml "test/**/*.xml"
ls -al ./*.xml
# We'll tag this to the Turbopack service, not the next.js
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/setup-nextjs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,17 @@ 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 "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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ jobs:
env:
DATADOG_API_KEY: ${{ secrets.DD_KEY_TURBOPACK }}
run: |
npm install -g @datadog/datadog-ci
npm install -g @datadog/datadog-ci @aws-sdk/property-provider
# Query raw benchmark output, create key:value pairs for each benchmark entries.
# The generated key name is compact format the path of the benchmark entry, i.e
# `base.hmr_to_commit.CSR.1000.mean`
Expand Down
Loading