Unverified Commit 0541251f authored by Jamiboy Mohammad's avatar Jamiboy Mohammad Committed by GitHub

test: remove per-test Corepack overrides now that deploy mode enables it (#99945)

## Summary

#95360 sets `ENABLE_EXPERIMENTAL_COREPACK=1` for every deployment in
`test/lib/next-modes/next-deploy.ts`, so Vercel now installs deploy
tests with the generated `package.json#packageManager` (pnpm). The
per-test workarounds added to get individual suites deploying are now
redundant:

- Remove `env: { ENABLE_EXPERIMENTAL_COREPACK: '1' }` from 13
`nextTestSetup` call sites across 12 test files: `geist-font`,
`gssp-redirect`, `gssp-redirect-base-path`,
`rewrite-with-browser-history`, `router-hash-navigation`,
`scroll-back-restoration`, `relay-graphql-swc-multi-project` (x2),
`nx-handling`, `import-meta-glob-monorepo`, `non-root-project-monorepo`,
`server-source-maps`, `fake-frame-source-maps`, and
`transpile-packages-typescript-foreign` (x2).
- Remove `test/e2e/transpile-packages-typescript-foreign/vercel.json`.
Its only purpose was `installCommand: "pnpm install"` to stop Vercel
from installing with npm. This is a separate commit in case it should be
dropped.

## Verification

- `git grep ENABLE_EXPERIMENTAL_COREPACK` now only matches
`test/lib/next-modes/next-deploy.ts`.
- Not run: `pnpm test-deploy-turbo` on the affected suites (pending a
deploy test run on this branch).

<!-- NEXT_JS_LLM -->

---------
Co-authored-by: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 2d0da212
...@@ -36,7 +36,6 @@ testFn('import-meta-glob-monorepo', () => { ...@@ -36,7 +36,6 @@ testFn('import-meta-glob-monorepo', () => {
buildCommand: 'pnpm build', buildCommand: 'pnpm build',
startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start', startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start',
installCommand: 'pnpm i', installCommand: 'pnpm i',
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('should resolve a `/`-rooted pattern from the project directory, like a plain import', async () => { it('should resolve a `/`-rooted pattern from the project directory, like a plain import', async () => {
......
...@@ -37,7 +37,6 @@ describe('non-root-project-monorepo', () => { ...@@ -37,7 +37,6 @@ describe('non-root-project-monorepo', () => {
buildCommand: 'pnpm build', buildCommand: 'pnpm build',
startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start', startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start',
installCommand: 'pnpm i', installCommand: 'pnpm i',
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
function sourceFileUrl(file: string) { function sourceFileUrl(file: string) {
......
...@@ -13,9 +13,6 @@ describe('nx-handling', () => { ...@@ -13,9 +13,6 @@ describe('nx-handling', () => {
path.join(__dirname, 'apps/next-nx-test/next.config.js') path.join(__dirname, 'apps/next-nx-test/next.config.js')
), ),
}, },
env: {
ENABLE_EXPERIMENTAL_COREPACK: '1',
},
buildCommand: 'pnpm run build', buildCommand: 'pnpm run build',
startCommand: isNextDev ? 'pnpm run dev' : 'pnpm run start', startCommand: isNextDev ? 'pnpm run dev' : 'pnpm run start',
packageJson: { packageJson: {
......
...@@ -135,8 +135,6 @@ describe('app-dir - server source maps - fake frame source maps', () => { ...@@ -135,8 +135,6 @@ describe('app-dir - server source maps - fake frame source maps', () => {
dependencies, dependencies,
files: path.join(__dirname, 'fixtures/default'), files: path.join(__dirname, 'fixtures/default'),
// This suite requires runtime logs and a local Node.js inspector. // This suite requires runtime logs and a local Node.js inspector.
// Use the declared pnpm version on Vercel to install link: dependencies.
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
// Expose the inspector on a random port. // Expose the inspector on a random port.
startArgs: ['--inspect=0'], startArgs: ['--inspect=0'],
}) })
......
...@@ -26,8 +26,6 @@ describe('app-dir - server source maps', () => { ...@@ -26,8 +26,6 @@ describe('app-dir - server source maps', () => {
dependencies, dependencies,
files: path.join(__dirname, 'fixtures/default'), files: path.join(__dirname, 'fixtures/default'),
// Deploy tests don't have access to runtime logs. // Deploy tests don't have access to runtime logs.
// Use the declared pnpm version on Vercel to install link: dependencies.
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('logged errors have a sourcemapped stack with a codeframe', async () => { it('logged errors have a sourcemapped stack with a codeframe', async () => {
......
...@@ -4,7 +4,6 @@ import { waitForNoRedbox } from 'next-test-utils' ...@@ -4,7 +4,6 @@ import { waitForNoRedbox } from 'next-test-utils'
describe('geist-font', () => { describe('geist-font', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
dependencies: { dependencies: {
geist: 'latest', geist: 'latest',
}, },
......
...@@ -10,7 +10,6 @@ describe('GS(S)P Redirect with basePath', () => { ...@@ -10,7 +10,6 @@ describe('GS(S)P Redirect with basePath', () => {
react: '19.3.0-canary-da9325b5-20260417', react: '19.3.0-canary-da9325b5-20260417',
'react-dom': '19.3.0-canary-da9325b5-20260417', 'react-dom': '19.3.0-canary-da9325b5-20260417',
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('should apply temporary redirect when visited directly for GSSP page', async () => { it('should apply temporary redirect when visited directly for GSSP page', async () => {
......
...@@ -8,7 +8,6 @@ describe('GS(S)P Redirect Support', () => { ...@@ -8,7 +8,6 @@ describe('GS(S)P Redirect Support', () => {
react: '19.3.0-canary-fef12a01-20260413', react: '19.3.0-canary-fef12a01-20260413',
'react-dom': '19.3.0-canary-fef12a01-20260413', 'react-dom': '19.3.0-canary-fef12a01-20260413',
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('should apply temporary redirect when visited directly for GSSP page', async () => { it('should apply temporary redirect when visited directly for GSSP page', async () => {
......
...@@ -29,7 +29,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => { ...@@ -29,7 +29,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
overrideFiles: { overrideFiles: {
'vercel.json': new FileRef(join(__dirname, 'vercel-project-a.json')), 'vercel.json': new FileRef(join(__dirname, 'vercel-project-a.json')),
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
dependencies: { dependencies: {
'relay-compiler': '21.0.1', 'relay-compiler': '21.0.1',
'relay-runtime': '21.0.1', 'relay-runtime': '21.0.1',
...@@ -73,7 +72,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => { ...@@ -73,7 +72,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
overrideFiles: { overrideFiles: {
'vercel.json': new FileRef(join(__dirname, 'vercel-project-b.json')), 'vercel.json': new FileRef(join(__dirname, 'vercel-project-b.json')),
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
dependencies: { dependencies: {
'relay-compiler': '21.0.1', 'relay-compiler': '21.0.1',
'relay-runtime': '21.0.1', 'relay-runtime': '21.0.1',
......
...@@ -7,7 +7,6 @@ describe('rewrites persist with browser history actions', () => { ...@@ -7,7 +7,6 @@ describe('rewrites persist with browser history actions', () => {
react: '19.3.0-canary-fef12a01-20260413', react: '19.3.0-canary-fef12a01-20260413',
'react-dom': '19.3.0-canary-fef12a01-20260413', 'react-dom': '19.3.0-canary-fef12a01-20260413',
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('back-button should go back to rewritten path successfully', async () => { it('back-button should go back to rewritten path successfully', async () => {
......
...@@ -7,7 +7,6 @@ describe('router hash navigation', () => { ...@@ -7,7 +7,6 @@ describe('router hash navigation', () => {
react: '19.3.0-canary-fef12a01-20260413', react: '19.3.0-canary-fef12a01-20260413',
'react-dom': '19.3.0-canary-fef12a01-20260413', 'react-dom': '19.3.0-canary-fef12a01-20260413',
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('scrolls to top when href="/" and url already contains a hash', async () => { it('scrolls to top when href="/" and url already contains a hash', async () => {
......
...@@ -8,7 +8,6 @@ describe('Scroll Back Restoration Support', () => { ...@@ -8,7 +8,6 @@ describe('Scroll Back Restoration Support', () => {
react: '19.3.0-canary-fef12a01-20260413', react: '19.3.0-canary-fef12a01-20260413',
'react-dom': '19.3.0-canary-fef12a01-20260413', 'react-dom': '19.3.0-canary-fef12a01-20260413',
}, },
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
it('should restore the scroll position on navigating back', async () => { it('should restore the scroll position on navigating back', async () => {
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// vercel.json uses pnpm so file: dependencies are installed inside node_modules. // pnpm installs file: dependencies inside node_modules. npm would link them to
// npm links them to fixture source, which is transpiled without transpilePackages. // fixture source, which is transpiled without transpilePackages.
describe('transpile-packages-typescript-foreign', () => { describe('transpile-packages-typescript-foreign', () => {
describe('without transpilePackages', () => { describe('without transpilePackages', () => {
const { next, isNextDev } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
// Use the fixture's packageManager version rather than Vercel's default pnpm.
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
dependencies: { dependencies: {
pkg: `file:./pkg`, pkg: `file:./pkg`,
}, },
...@@ -44,7 +42,6 @@ Module parse failed: Unexpected token`) ...@@ -44,7 +42,6 @@ Module parse failed: Unexpected token`)
describe('with transpilePackages', () => { describe('with transpilePackages', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
dependencies: { dependencies: {
pkg: `file:./pkg`, pkg: `file:./pkg`,
}, },
......
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