Unverified Commit 3a4c3674 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

[ci] Use Turbopack in non-webpack-specific e2e test jobs (#94005)

Turbopack is the default bundler, so we should prioritize testing that
in these variants of the CI runs (cache components, node streams,
windows).

There's also some limited evidence that indicates that it might be
faster for e2e test runs, though that's not conclusive (because of
different shard sizes):
https://vercel.slack.com/archives/C0B0LKK5QD7/p1779320615501259
parent 6dbba05e
...@@ -806,11 +806,11 @@ jobs: ...@@ -806,11 +806,11 @@ jobs:
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
# Should this be using turbopack? a variation?
afterBuild: | afterBuild: |
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export IS_WEBPACK_TEST=1
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export IS_TURBOPACK_TEST=1
export TURBOPACK_DEV=1
node run-tests.js \ node run-tests.js \
test/e2e/app-dir/app/index.test.ts \ test/e2e/app-dir/app/index.test.ts \
...@@ -832,8 +832,10 @@ jobs: ...@@ -832,8 +832,10 @@ jobs:
nodeVersion: 20.9.0 nodeVersion: 20.9.0
afterBuild: | afterBuild: |
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export IS_WEBPACK_TEST=1
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export IS_TURBOPACK_TEST=1
export TURBOPACK_BUILD=1
node run-tests.js --type production \ node run-tests.js --type production \
--concurrency 4 \ --concurrency 4 \
test/production/pages-dir/production/test/index.test.ts \ test/production/pages-dir/production/test/index.test.ts \
...@@ -855,8 +857,9 @@ jobs: ...@@ -855,8 +857,9 @@ jobs:
with: with:
afterBuild: | afterBuild: |
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export IS_WEBPACK_TEST=1
export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true export __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
export IS_TURBOPACK_TEST=1
export TURBOPACK_BUILD=1
node run-tests.js --type production \ node run-tests.js --type production \
test/e2e/app-dir/app/index.test.ts \ test/e2e/app-dir/app/index.test.ts \
...@@ -962,7 +965,8 @@ jobs: ...@@ -962,7 +965,8 @@ jobs:
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true
export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json" export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json"
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export IS_WEBPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_DEV=1
node run-tests.js \ node run-tests.js \
--timings \ --timings \
...@@ -997,7 +1001,8 @@ jobs: ...@@ -997,7 +1001,8 @@ jobs:
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true
export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json" export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json"
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export IS_WEBPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_BUILD=1
node run-tests.js \ node run-tests.js \
--timings \ --timings \
...@@ -1033,7 +1038,8 @@ jobs: ...@@ -1033,7 +1038,8 @@ jobs:
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true
export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json" export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json"
export NEXT_TEST_MODE=dev export NEXT_TEST_MODE=dev
export IS_WEBPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_DEV=1
node run-tests.js \ node run-tests.js \
--timings \ --timings \
...@@ -1069,7 +1075,8 @@ jobs: ...@@ -1069,7 +1075,8 @@ jobs:
export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true export __NEXT_EXPERIMENTAL_APP_NEW_SCROLL_HANDLER=true
export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json" export NEXT_EXTERNAL_TESTS_FILTERS="test/cache-components-tests-manifest.json"
export NEXT_TEST_MODE=start export NEXT_TEST_MODE=start
export IS_WEBPACK_TEST=1 export IS_TURBOPACK_TEST=1
export TURBOPACK_BUILD=1
node run-tests.js \ node run-tests.js \
--timings \ --timings \
......
...@@ -48,17 +48,20 @@ describe('non-root-project-monorepo', () => { ...@@ -48,17 +48,20 @@ describe('non-root-project-monorepo', () => {
}) })
}) })
// TODO: These file URIs are wrong on turbopack+windows:
// https://en.wikipedia.org/wiki/File_URI_scheme
// The URIs should always use forward slashes, but use backslashes on windows.
describe('import.meta.url', () => { describe('import.meta.url', () => {
it('should work during RSC', async () => { it('should work during RSC', async () => {
const $ = await next.render$('/import-meta-url-rsc') const $ = await next.render$('/import-meta-url-rsc')
expect($('p').text()).toMatch( expect($('p').text().replaceAll('\\', '/')).toMatch(
/^file:\/\/.*\/next-install-[^/]+\/apps\/web\/app\/import-meta-url-rsc\/page.tsx$/ /^file:\/\/.*\/next-install-[^/]+\/apps\/web\/app\/import-meta-url-rsc\/page.tsx$/
) )
}) })
it('should work during SSR', async () => { it('should work during SSR', async () => {
const $ = await next.render$('/import-meta-url-ssr') const $ = await next.render$('/import-meta-url-ssr')
expect($('p').text()).toMatch( expect($('p').text().replaceAll('\\', '/')).toMatch(
/^file:\/\/.*\/next-install-[^/]+\/apps\/web\/app\/import-meta-url-ssr\/page.tsx$/ /^file:\/\/.*\/next-install-[^/]+\/apps\/web\/app\/import-meta-url-ssr\/page.tsx$/
) )
}) })
...@@ -68,11 +71,13 @@ describe('non-root-project-monorepo', () => { ...@@ -68,11 +71,13 @@ describe('non-root-project-monorepo', () => {
await waitForNoRedbox(browser) await waitForNoRedbox(browser)
if (isTurbopack) { if (isTurbopack) {
// Turbopack intentionally doesn't expose the full path to the browser bundles // Turbopack intentionally doesn't expose the full path to the browser bundles
expect(await browser.elementByCss('p').text()).toBe( expect(
'file:///ROOT/apps/web/app/import-meta-url-ssr/page.tsx' (await browser.elementByCss('p').text()).replaceAll('\\', '/')
) ).toBe('file:///ROOT/apps/web/app/import-meta-url-ssr/page.tsx')
} else { } else {
expect(await browser.elementByCss('p').text()).toMatch( expect(
(await browser.elementByCss('p').text()).replaceAll('\\', '/')
).toMatch(
/^file:\/\/.*\/next-install-[^/]+\/apps\/web\/app\/import-meta-url-ssr\/page.tsx$/ /^file:\/\/.*\/next-install-[^/]+\/apps\/web\/app\/import-meta-url-ssr\/page.tsx$/
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment