Unverified Commit 60cb5b3e authored by Jamiboy Mohammad's avatar Jamiboy Mohammad Committed by GitHub

test: enable deployment fixtures with Corepack and portable tarballs (#99192)

## Summary

Enable deployment coverage for seven fixture suites while preserving
dependency declarations, test bodies, assertions, and unrelated mode
restrictions.

- Set `ENABLE_EXPERIMENTAL_COREPACK: '1'` for `geist-font`,
`gssp-redirect`, `rewrite-with-browser-history`,
`router-hash-navigation`, and `scroll-back-restoration` so Vercel
installs with the pnpm version declared by the generated
`packageManager` field. These fixtures do not require committed pnpm
lockfiles or `npm_config_frozen_lockfile` overrides.
- Use fixture-relative tarball dependencies for `self-importing-package`
and `typeof-window` so deployment installation does not refer to paths
on the GitHub Actions runner.
- Apply the Corepack setting to both suites using the shared source-map
fixture. Retain their deployment exclusions because their assertions
require runtime logs or a local Node.js inspector; they are not counted
as deployment passes.

## Verification

Ran focused `pnpm test-deploy-turbo --runTestsByPath` tests with
`VERCEL_TURBOPACK_TEST_TEAM=vtest314-next-e2e-tests`,
`NEXT_E2E_TEST_TIMEOUT=240000`, and `NEXT_TEST_VERSION=canary` (resolved
to `16.4.0-canary.53`):

- All five affected deploy-enabled suites passed in normal mode: **26/26
tests**.
- With `__NEXT_CACHE_COMPONENTS=true` and
`__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS=true`, the same five suites
passed: **26/26 tests**. Remote build logs confirmed both features were
enabled.
- All ten deployments detected the Corepack flag and `pnpm@10.33.0`,
installed successfully without source lockfiles, and executed the
browser/HTTP assertions.
- The unchanged `self-importing-package` and `typeof-window` tarball
fixtures passed in both modes in the preceding validation (two tests per
mode); this update does not touch them.
- Prettier, ESLint, and `git diff --check` passed. The Next.js watch
build completed with zero type errors. The full pre-push build completed
17/18 tasks; native SWC remains blocked because Cargo is unavailable
locally.

These focused runs validate the fixture changes against published
canary, not all CI checks on the updated PR head.

<!-- NEXT_JS_LLM -->
parent fbd032ff
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode. // TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// This test is skipped when deployed because the local tarball appears corrupted // This test is skipped when deployed because the local tarball appears corrupted
...@@ -9,7 +8,7 @@ describe('self-importing-package', () => { ...@@ -9,7 +8,7 @@ describe('self-importing-package', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
'internal-pkg': `file:${path.join(__dirname, 'internal-pkg.tar')}`, 'internal-pkg': 'file:./internal-pkg.tar',
}, },
}) })
......
...@@ -131,7 +131,10 @@ describe('app-dir - server source maps - fake frame source maps', () => { ...@@ -131,7 +131,10 @@ describe('app-dir - server source maps - fake frame source maps', () => {
const { skipped, next, isNextDev, isTurbopack } = nextTestSetup({ const { skipped, next, isNextDev, isTurbopack } = nextTestSetup({
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.
skipDeployment: true, skipDeployment: true,
// 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'],
}) })
......
...@@ -22,8 +22,9 @@ describe('app-dir - server source maps', () => { ...@@ -22,8 +22,9 @@ 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.
// Manually verify that the runtime logs match.
skipDeployment: true, skipDeployment: true,
// Use the declared pnpm version on Vercel to install link: dependencies.
env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
if (skipped) return if (skipped) return
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import path from 'path'
describe('typeof-window', () => { describe('typeof-window', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// This test is skipped when deployed because the local tarball appears corrupted
// It also doesn't seem particularly useful to test when deployed
skipDeployment: true,
dependencies: { dependencies: {
'my-differentiated-files': `file:${path.join(__dirname, 'my-differentiated-files.tar')}`, 'my-differentiated-files': 'file:./my-differentiated-files.tar',
}, },
}) })
if (skipped) return
it('should work using cheerio', async () => { it('should work using cheerio', async () => {
const $ = await next.render$('/') const $ = await next.render$('/')
expect($('h1').text()).toBe('Page loaded') expect($('h1').text()).toBe('Page loaded')
......
...@@ -4,9 +4,7 @@ import { waitForNoRedbox } from 'next-test-utils' ...@@ -4,9 +4,7 @@ import { waitForNoRedbox } from 'next-test-utils'
describe('geist-font', () => { describe('geist-font', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// `geist@latest` has a peer dependency issue with the latest Next.js. env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
// see: https://github.com/vercel/geist-font/pull/117
skipDeployment: true,
dependencies: { dependencies: {
geist: 'latest', geist: 'latest',
}, },
......
...@@ -2,15 +2,14 @@ import { nextTestSetup, isNextStart } from 'e2e-utils' ...@@ -2,15 +2,14 @@ import { nextTestSetup, isNextStart } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
describe('GS(S)P Redirect Support', () => { describe('GS(S)P Redirect Support', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
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',
}, },
skipDeployment: true, env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
}) })
if (skipped) return
it('should apply temporary redirect when visited directly for GSSP page', async () => { it('should apply temporary redirect when visited directly for GSSP page', async () => {
const res = await next.fetch('/gssp-blog/redirect-1', { const res = await next.fetch('/gssp-blog/redirect-1', {
......
...@@ -7,8 +7,7 @@ describe('rewrites persist with browser history actions', () => { ...@@ -7,8 +7,7 @@ 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',
}, },
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode. env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
skipDeployment: true,
}) })
it('back-button should go back to rewritten path successfully', async () => { it('back-button should go back to rewritten path successfully', async () => {
......
...@@ -7,8 +7,7 @@ describe('router hash navigation', () => { ...@@ -7,8 +7,7 @@ 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',
}, },
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode. env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
skipDeployment: true,
}) })
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,8 +8,7 @@ describe('Scroll Back Restoration Support', () => { ...@@ -8,8 +8,7 @@ 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',
}, },
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode. env: { ENABLE_EXPERIMENTAL_COREPACK: '1' },
skipDeployment: true,
}) })
it('should restore the scroll position on navigating back', async () => { it('should restore the scroll position on navigating back', async () => {
......
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