Skip to content

Commit b811240

Browse files
authored
ci(tests): enable turbopack /e2e tests (vercel#55681)
### What? Closes WEB-1615 I thought I couldn't grab the correct count of test suite in the datadog as I was seeing huge count mismatches. Actually, it was because we were not running all of the tests. PR amends - run all the tests under manifests - ensure all the test list in the manifest actually exists lastly and sadly - disable few tests too flaky
1 parent d665c3d commit b811240

File tree

2 files changed

+45
-27
lines changed

2 files changed

+45
-27
lines changed

.github/workflows/build_and_test.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
uses: ./.github/workflows/build_reusable.yml
3434
with:
3535
skipInstallBuild: 'yes'
36+
# Ensure all of the tests listed in turbopack test manifest actually exists;
37+
# i.e after removing an actual test and if it still stays in the manifest
38+
afterBuild: node -e 'require(\"./test/turbopack-tests-manifest.js\").verifyEnabledTestPath()'
3639
secrets: inherit
3740

3841
build-next:
@@ -151,6 +154,21 @@ jobs:
151154
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.js" TURBOPACK=1 node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type integration
152155
secrets: inherit
153156

157+
# --type production also runs tests/e2e
158+
test-turbopack-prod:
159+
name: test turbopack prod
160+
needs: ['build-native', 'build-next']
161+
strategy:
162+
fail-fast: false
163+
matrix:
164+
group: [1, 2, 3, 4, 5]
165+
uses: ./.github/workflows/build_reusable.yml
166+
with:
167+
nodeVersion: 16
168+
skipForDocsOnly: 'yes'
169+
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.js" TURBOPACK=1 NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production
170+
secrets: inherit
171+
154172
test-next-swc-wasm:
155173
name: test next-swc wasm
156174
needs: ['build-native', 'build-next']
@@ -227,7 +245,16 @@ jobs:
227245
secrets: inherit
228246

229247
report-test-results:
230-
needs: ['test-unit', 'test-dev', 'test-prod', 'test-integration']
248+
needs:
249+
[
250+
'test-unit',
251+
'test-dev',
252+
'test-prod',
253+
'test-integration',
254+
'test-turbopack-dev',
255+
'test-turbopack-integration',
256+
'test-turbopack-prod',
257+
]
231258
uses: ./.github/workflows/build_reusable.yml
232259
with:
233260
skipForDocsOnly: 'yes'

test/turbopack-tests-manifest.js

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,20 @@ const enabledTests = [
2525
'test/development/jsconfig-path-reloading/index.test.ts',
2626
'test/development/middleware-warnings/index.test.ts',
2727
'test/development/next-font/deprecated-package.test.ts',
28-
'test/development/project-directory-with-styled.jsx',
2928
'test/development/repeated-dev-edits/repeated-dev-edits.test.ts',
3029
'test/development/tsconfig-path-reloading/index.test.ts',
3130
'test/development/typescript-auto-install/index.test.ts',
3231
'test/development/watch-config-file/index.test.ts',
33-
'test/e2e/404-page-router/index.test.ts',
34-
'test/e2e/app-dir/actions/app-action-export.test.ts',
35-
'test/e2e/app-dir/actions/app-action-invalid.test.ts',
36-
'test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts',
37-
'test/e2e/app-dir/app-edge-root-layout/index.test.ts',
3832
'test/e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts',
39-
'test/e2e/app-dir/app-routes-trailing-slash/app-routes-trailing-slash.test.ts',
40-
'test/e2e/app-dir/app-simple-routes/app-simple-routes.test.ts',
4133
'test/e2e/app-dir/app-static/app-fetch-logging.test.ts',
42-
'test/e2e/app-dir/app-static/app-static-custom-cache-handler-esm.test.ts',
4334
'test/e2e/app-dir/app-validation/validation.test.ts',
4435
'test/e2e/app-dir/asset-prefix/asset-prefix.test.ts',
4536
'test/e2e/app-dir/async-component-preload/async-component-preload.test.ts',
4637
'test/e2e/app-dir/autoscroll-with-css-modules/index.test.ts',
47-
'test/e2e/app-dir/base-path/index.test.ts',
4838
'test/e2e/app-dir/build-size/index.test.ts',
4939
'test/e2e/app-dir/crypto-globally-available/crypto-globally-available.test.ts',
5040
'test/e2e/app-dir/deopted-into-client-rendering-warning/deopted-into-client-rendering-warning.test.ts',
5141
'test/e2e/app-dir/front-redirect-issue/front-redirect-issue.test.ts',
52-
'test/e2e/app-dir/global-error/basic/index.test.ts',
53-
'test/e2e/app-dir/global-error/layout-error/index.test.ts',
5442
'test/e2e/app-dir/headers-static-bailout/headers-static-bailout.test.ts',
5543
'test/e2e/app-dir/hello-world/hello-world.test.ts',
5644
'test/e2e/app-dir/i18n-hybrid/i18n-hybrid.test.js',
@@ -59,32 +47,20 @@ const enabledTests = [
5947
'test/e2e/app-dir/layout-params/layout-params.test.ts',
6048
'test/e2e/app-dir/metadata-missing-metadata-base/index.test.ts',
6149
'test/e2e/app-dir/metadata-suspense/index.test.ts',
62-
'test/e2e/app-dir/navigation/navigation.test.ts',
6350
'test/e2e/app-dir/next-config/index.test.ts',
64-
'test/e2e/app-dir/not-found/css-precedence/index.test.ts',
65-
'test/e2e/app-dir/not-found/group-route-root-not-found/index.test.ts',
66-
'test/e2e/app-dir/rewrites-redirects/rewrites-redirects.test.ts',
67-
'test/e2e/app-dir/root-layout-redirect/root-layout-redirect.test.ts',
6851
'test/e2e/app-dir/route-page-manifest-bug/route-page-manifest-bug.test.ts',
6952
'test/e2e/app-dir/router-stuck-dynamic-static-segment/router-stuck-dynamic-static-segment.test.ts',
70-
'test/e2e/app-dir/search-params-react-key/layout-params.test.ts',
7153
'test/e2e/app-dir/searchparams-static-bailout/searchparams-static-bailout.test.ts',
7254
'test/e2e/app-dir/similar-pages-paths/similar-pages-paths.test.ts',
7355
'test/e2e/app-dir/test-template/{{ toFileName name }}/{{ toFileName name }}.test.ts',
7456
'test/e2e/app-dir/third-parties/basic.test.ts',
7557
'test/e2e/app-dir/use-params/use-params.test.ts',
7658
'test/e2e/app-dir/use-selected-layout-segment-s/use-selected-layout-segment-s.test.ts',
77-
'test/e2e/app-dir/with-exported-function-config/with-exported-function-config.test.ts',
7859
'test/e2e/browserslist-extends/index.test.ts',
7960
'test/e2e/children-page/index.test.ts',
8061
'test/e2e/config-promise-export/async-function.test.ts',
8162
'test/e2e/config-promise-export/promise.test.ts',
82-
'test/e2e/disable.js',
8363
'test/e2e/dynamic-route-interpolation/index.test.ts',
84-
'test/e2e/edge-api-endpoi.ts',
85-
'test/e2e/edge-can-read-request-body/index.test.ts',
86-
'test/e2e/edge-compiler-module-expo.ts',
87-
'test/e2e/edge-async-local-storage/index.test.ts',
8864
'test/e2e/handle-non-hoisted-swc-helpers/index.test.ts',
8965
'test/e2e/hello-world/hello-world.test.ts',
9066
'test/e2e/i18n-api-support/index.test.ts',
@@ -145,13 +121,28 @@ const enabledTests = [
145121
'test/production/jest/rsc/lib/utils.test.js',
146122
'test/production/jest/transpile-packages.test.ts',
147123
'test/production/postcss-plugin-config-as-string/index.test.ts',
148-
'test/production/suppo.ts',
149124

150125
// disabled due to nextConfig.distDir
151126
//'test/integration/trailing-slash-dist/test/index.test.js',
152127
]
153128

154-
module.exports = { enabledTests }
129+
/// Naive check to ensure that the enabled tests actually exist
130+
const verifyEnabledTestPath = () => {
131+
const fs = require('fs')
132+
const nonExistTests = enabledTests.filter(
133+
(testPath) => !fs.existsSync(testPath)
134+
)
135+
136+
if (Array.isArray(nonExistTests) && nonExistTests.length > 0) {
137+
console.error(
138+
`The following tests are enabled but do not exist:`,
139+
nonExistTests
140+
)
141+
throw new Error('Invalid test path(s) found')
142+
}
143+
}
144+
145+
module.exports = { enabledTests, verifyEnabledTestPath }
155146

156147
/* Old turbopack enabled tests:
157148

0 commit comments

Comments
 (0)