28
28
# Enabling backtrace will makes snapshot tests fail
29
29
RUST_BACKTRACE : 0
30
30
NEXT_TELEMETRY_DISABLED : 1
31
- # Path to the next-dev binary located in **docker container** image.
32
- # To use this, set __INTERNAL_CUSTOM_TURBOPACK_BINARY to the path. Not being used currently.
33
- NEXT_DEV_BIN : /work/next-dev
34
- # Path to the custom next-swc bindings located in **docker container** image.
35
- NEXT_BINDINGS_BIN : /work/packages/next-swc/native/next-swc.linux-x64-gnu.node
36
- FAILED_TEST_LIST_PATH : /work/integration-test-data/test-results/main/failed-test-path-list.json
37
- # Glob pattern to run specific tests with --turbo.
38
- NEXT_DEV_TEST_GLOB : " *"
31
+ TEST_CONCURRENCY : 6
39
32
# pnpm version should match to what upstream next.js uses
40
33
PNPM_VERSION : 7.24.3
34
+ DATADOG_API_KEY : ${{ secrets.DD_KEY_TURBOPACK }}
35
+ DATADOG_TRACE_NEXTJS_TEST : ' true'
36
+ DD_ENV : ' ci'
37
+ # Turbopack specific customization for the test runner
38
+ __INTERNAL_NEXT_DEV_TEST_TURBO_DEV : TRUE
39
+ __INTERNAL_CUSTOM_TURBOPACK_BINDINGS : ${{ github.workspace }}/packages/next-swc/native/next-swc.linux-x64-gnu.node
40
+ NEXT_TEST_SKIP_RETRY_MANIFEST : ${{ github.workspace }}/integration-test-data/test-results/main/failed-test-path-list.json
41
+ NEXT_TEST_CONTINUE_ON_ERROR : TRUE
42
+ NEXT_E2E_TEST_TIMEOUT : 240000
43
+ NEXT_TEST_JOB : 1
41
44
42
45
jobs :
43
46
# First, build next-dev and Next.js both to execute across tests.
@@ -49,50 +52,57 @@ jobs:
49
52
50
53
# Actual test scheduling. These jobs mimic the same jobs in Next.js repo,
51
54
# which we do allow some of duplications to make it easier to update if upstream changes.
52
- # Refer build_test_deploy .yml in the Next.js repo for more details.
53
- test_dev :
55
+ # Refer build_and_test .yml in the Next.js repo for more details.
56
+ test-dev :
54
57
# This job name is being used in github action to collect test results. Do not change it, or should update
55
58
# ./.github/actions/next-integration-stat to match the new name.
56
59
name : Next.js integration test (Development)
57
- runs-on : ubuntu-latest-8-core-oss
60
+ timeout-minutes : 180
61
+ runs-on : ubuntu-latest-16-core-oss
58
62
needs : [setup_nextjs]
59
63
strategy :
64
+ fail-fast : false
60
65
matrix :
61
- node : [16, 18]
62
- group : [1, 2, 3, 4, 5]
66
+ group : [1, 2, 3]
63
67
64
68
steps :
65
69
- uses : actions/cache/restore@v3
66
70
id : restore-build
67
71
with :
68
72
path : ./*
69
- key : ${{ inputs.version }}-${{ github.sha }}
73
+ key : ${{ inputs.version }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt}}-${{ github.run_number }}
70
74
fail-on-cache-miss : true
71
-
72
- # This step is quite same as upstream next.js integration execution, but with some differences:
73
- # Sets `__INTERNAL_CUSTOM_TURBOPACK_BINARY`, `__INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH` to setup custom turbopack.
74
- # Sets `NEXT_TEST_SKIP_RETRY_MANIFEST`, `NEXT_TEST_CONTINUE_ON_ERROR` to continue on error but do not retry on the known failed tests.
75
- # Do not set --timings flag
76
- - run : |
77
- docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && ls && curl https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_TEST_SKIP_RETRY_MANIFEST=${FAILED_TEST_LIST_PATH} NEXT_TEST_CONTINUE_ON_ERROR=TRUE NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev xvfb-run node run-tests.js --type development -g ${{ matrix.group }}/5 -c 1 >> /proc/1/fd/1"
78
- name: Run test/development
75
+ - name : Run test/development
76
+ run : |
77
+ ls $NEXT_TEST_SKIP_RETRY_MANIFEST
78
+ npm i -g pnpm@$PNPM_VERSION && pnpm --version
79
+ npm i -g yarn
80
+ sudo npx playwright install-deps && pnpm playwright install
81
+ 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)$'
82
+ ls test
83
+ ls test/turbopack-test-junit-report
79
84
# It is currently expected to fail some of next.js integration test, do not fail CI check.
80
85
continue-on-error : true
81
86
env :
82
- RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDev / Group ${{ matrix.group }}
83
87
# marker to parse log output, do not delete / change.
84
88
NEXT_INTEGRATION_TEST : true
89
+ - name : Upload test reports artifact
90
+ uses : actions/upload-artifact@v3
91
+ with :
92
+ name : Test trace reports
93
+ path : |
94
+ test/turbopack-test-junit-report
95
+ if-no-files-found : ignore
85
96
86
- test_dev_e2e :
87
- # This job name is being used in github action to collect test results. Do not change it, or should update
88
- # ./.github/actions/next-integration-stat to match the new name.
89
- name : Next.js integration test (e2e/Development)
90
- runs-on : ubuntu-latest-8-core-oss
97
+ test-prod :
98
+ name : Next.js integration test (Production)
91
99
needs : [setup_nextjs]
100
+ runs-on : ubuntu-latest-16-core-oss
101
+ timeout-minutes : 180
92
102
strategy :
103
+ fail-fast : false
93
104
matrix :
94
- node : [16, 18]
95
- group : [1, 2, 3, 4, 5, 6, 7]
105
+ group : [1, 2, 3]
96
106
97
107
steps :
98
108
- uses : actions/cache/restore@v3
@@ -101,121 +111,32 @@ jobs:
101
111
path : ./*
102
112
key : ${{ inputs.version }}-${{ github.sha }}
103
113
fail-on-cache-miss : true
104
-
105
- - run : |
106
- docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && ls && curl https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_TEST_SKIP_RETRY_MANIFEST=${FAILED_TEST_LIST_PATH} NEXT_TEST_CONTINUE_ON_ERROR=TRUE NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev xvfb-run node run-tests.js --type e2e -g ${{ matrix.group }}/7 -c 1 >> /proc/1/fd/1"
107
- name: Run test/e2e (dev)
114
+ - name : Run test/production
115
+ run : |
116
+ npm i -g pnpm@$PNPM_VERSION && pnpm --version
117
+ npm i -g yarn
118
+ sudo npx playwright install-deps && pnpm playwright install
119
+ NEXT_TEST_MODE=start node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(production|e2e)/.*\.test\.(js|jsx|ts|tsx)$'
108
120
continue-on-error : true
109
121
env :
110
- RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDevE2E / Group ${{ matrix.group }} / Node ${{ matrix.node }}
111
- NEXT_TEST_MODE: dev
112
- RECORD_REPLAY_TEST_METRICS: 1
113
122
NEXT_INTEGRATION_TEST : true
114
-
115
- test_cna :
116
- # This job name is being used in github action to collect test results. Do not change it, or should update
117
- # ./.github/actions/next-integration-stat to match the new name.
118
- name : Next.js integration test (Create Next App) (No group)
119
- runs-on : ubuntu-latest-8-core-oss
120
- needs : [setup_nextjs]
121
- steps :
122
- - uses : actions/cache/restore@v3
123
- id : restore-build
124
- with :
125
- path : ./*
126
- key : ${{ inputs.version }}-${{ github.sha }}
127
- fail-on-cache-miss : true
128
-
129
- # TODO: This test currently seems to load wasm/swc and does not load the next-dev binary.
130
- # Temporary disabled until figure out details.
131
- # - run: |
132
- # docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v16 | FORCE=1 bash && npm i -g pnpm@${PNPM_VERSION} > /dev/null && __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_TEST_SKIP_RETRY_MANIFEST=${FAILED_TEST_LIST_PATH} NEXT_TEST_CONTINUE_ON_ERROR=TRUE NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 NEXT_TEST_CNA=1 xvfb-run node run-tests.js test/integration/create-next-app/index.test.ts test/integration/create-next-app/templates.test.ts -c 1 >> /proc/1/fd/1"
133
- # name: Run test/e2e (create-next-app)
134
- # continue-on-error: true
135
- # env:
136
- # RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDevE2E / Group ${{ matrix.group }} / Node ${{ matrix.node }}
137
- # NEXT_TEST_MODE: dev
138
- # RECORD_REPLAY_TEST_METRICS: 1
139
- # NEXT_INTEGRATION_TEST: true
140
-
141
- test_integration :
142
- # This job name is being used in github action to collect test results. Do not change it, or should update
143
- # ./.github/actions/next-integration-stat to match the new name.
144
- name : Next.js integration test (integration)
145
- runs-on : ubuntu-latest-8-core-oss
146
- needs : [setup_nextjs]
147
- strategy :
148
- fail-fast : false
149
- matrix :
150
- group :
151
- [
152
- 1,
153
- 2,
154
- 3,
155
- 4,
156
- 5,
157
- 6,
158
- 7,
159
- 8,
160
- 9,
161
- 10,
162
- 11,
163
- 12,
164
- 13,
165
- 14,
166
- 15,
167
- 16,
168
- 17,
169
- 18,
170
- 19,
171
- 20,
172
- 21,
173
- 22,
174
- 23,
175
- 24,
176
- 25,
177
- 26,
178
- 27,
179
- 28,
180
- ]
181
-
182
- steps :
183
- - uses : actions/cache/restore@v3
184
- id : restore-build
123
+ - name : Upload test reports artifact
124
+ uses : actions/upload-artifact@v3
185
125
with :
126
+ name : Test trace reports
186
127
path : |
187
- ./*
188
- key : ${{ inputs.version }}-${{ github.sha }}
189
- fail-on-cache-miss : true
128
+ test/turbopack-test-junit-report
129
+ if-no-files-found : ignore
190
130
191
- - run : |
192
- docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && ls && curl https://install-node.vercel.app/v16 | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_TEST_SKIP_RETRY_MANIFEST=${FAILED_TEST_LIST_PATH} NEXT_TEST_CONTINUE_ON_ERROR=TRUE NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 xvfb-run node run-tests.js -g ${{ matrix.group }}/28 -c 1 >> /proc/1/fd/1"
193
- name: Test Integration
194
- continue-on-error: true
195
- env:
196
- RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testIntegration / Group ${{ matrix.group }}
197
- NEXT_INTEGRATION_TEST: true
198
-
199
- test_flaky_subset :
200
- # This job name is being used in github action to collect test results. Do not change it, or should update
201
- # ./.github/actions/next-integration-stat to match the new name.
202
- name : Next.js integration test (FLAKY_SUBSET)
203
- runs-on : ubuntu-latest
131
+ test-integration :
132
+ name : Next.js integration test (Integration)
204
133
needs : [setup_nextjs]
205
- env :
206
- # List of test files to run that expected to pass always. Whole test suite should pass.
207
- TEST_FILES_LIST : |
208
- test/development/acceptance-app/dynamic-error.test.ts \
209
- test/development/acceptance-app/unsupported-app-features.test.ts \
210
- test/development/acceptance-app/ReactRefresh.test.ts \
211
- test/development/basic/legacy-decorators.test.ts \
212
- test/integration/plugin-mdx-rs/test/index.test.js \
213
- test/e2e/app-dir/underscore-ignore-app-paths/underscore-ignore-app-paths.test.ts \
214
- test/e2e/app-dir/app-alias/app-alias.test.ts
215
-
134
+ runs-on : ubuntu-latest-16-core-oss
135
+ timeout-minutes : 180
216
136
strategy :
137
+ fail-fast : false
217
138
matrix :
218
- node : [16 ]
139
+ group : [1, 2, 3, 4, 5, 6 ]
219
140
220
141
steps :
221
142
- uses : actions/cache/restore@v3
@@ -224,21 +145,27 @@ jobs:
224
145
path : ./*
225
146
key : ${{ inputs.version }}-${{ github.sha }}
226
147
fail-on-cache-miss : true
227
-
228
- - run : |
229
- docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && ls packages/next-swc/native && curl https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} && node scripts/install-native.mjs && __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_TEST_CONTINUE_ON_ERROR=TRUE NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev xvfb-run node run-tests.js --type development -c 1 $TEST_FILES_LIST >> /proc/1/fd/1"
230
- name: Run test/flaky_subset
231
- # This should not fail, but if fails collect result to update dashboard.
148
+ - name : Run test/integration
149
+ run : |
150
+ npm i -g pnpm@$PNPM_VERSION && pnpm --version
151
+ npm i -g yarn
152
+ sudo npx playwright install-deps && pnpm playwright install
153
+ node run-tests.js -g ${{ matrix.group }}/6 -c ${TEST_CONCURRENCY} --test-pattern '^(integration)/.*\.test\.(js|jsx|ts|tsx)$'
232
154
continue-on-error : true
233
155
env :
234
- # marker to parse log output, do not delete / change.
235
156
NEXT_INTEGRATION_TEST : true
157
+ - name : Upload test reports artifact
158
+ uses : actions/upload-artifact@v3
159
+ with :
160
+ name : Test trace reports
161
+ path : |
162
+ test/turbopack-test-junit-report
163
+ if-no-files-found : ignore
236
164
237
165
# Collect integration test results from execute_tests,
238
166
# Store it as github artifact for next step to consume.
239
167
collect_nextjs_integration_stat :
240
- needs :
241
- [test_dev, test_dev_e2e, test_cna, test_integration, test_flaky_subset]
168
+ needs : [test-dev, test-prod, test-integration]
242
169
name : Next.js integration test status report
243
170
runs-on : ubuntu-latest-8-core-oss
244
171
permissions :
@@ -263,3 +190,26 @@ jobs:
263
190
nextjs-test-results.json
264
191
failed-test-path-list.json
265
192
slack-payload.json
193
+
194
+ upload_test_trace :
195
+ needs : [test-dev, test-prod, test-integration]
196
+ name : Upload test trace to datadog
197
+ runs-on : ubuntu-latest-8-core-oss
198
+ steps :
199
+ - name : Checkout
200
+ uses : actions/checkout@v3
201
+ - name : Download test reports artifact
202
+ id : download-test-reports
203
+ uses : actions/download-artifact@v3
204
+ continue-on-error : true
205
+ with :
206
+ name : Test trace reports
207
+ path : test
208
+ - name : Upload test trace to datadog
209
+ continue-on-error : true
210
+ run : |
211
+
212
+ jrm ./nextjs-test-result-junit.xml "test/**/*.xml"
213
+ ls -al ./*.xml
214
+ # We'll tag this to the Turbopack service, not the next.js
215
+ DD_ENV=ci datadog-ci junit upload --tags test.type:turbopack.daily --service Turbopack ./nextjs-test-result-junit.xml
0 commit comments