Unverified Commit 3ca20b5a authored by Josh Story's avatar Josh Story Committed by GitHub

test: migrate Pages Router deploy exclusions to force gates (#98157)

## Summary

Migrate the remaining Pages Router, API route, i18n, custom route,
rewrite, redirect, and error-page deployment exclusions to `@force-gate`
and remove their `skipDeployment`/`skipped` control flow. This stack is
rooted at canary and independent of #98430; it preserves deployment
coverage already enabled on canary.

The custom-app-render and client-max-body-size files covered by #98994
and #98911 are omitted.

## Verification

- Compared test registration against canary in development, production,
and deploy modes with test bodies and hooks disabled (Webpack). Existing
active deployment assertions are preserved; development/production test
selection is unchanged apart from replacing empty skip placeholders with
skipped real tests.
- TypeScript, Prettier, and ESLint checks passed. Registration probes
use a default config for lazy predicates and do not exercise fixture
setup or test bodies.
- Full bootstrap attempted, but the local native SWC build fails at
`cargo metadata` with `EPERM`; full integration/deployment execution
remains for CI.

<!-- NEXT_JS_LLM -->

---------
Co-authored-by: 's avatarJamiboy Mohammad <jamiboym@gmail.com>
parent 4f392ad7
...@@ -34,6 +34,9 @@ module.exports = { ...@@ -34,6 +34,9 @@ module.exports = {
} }
` `
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It currently avoids creating five deployments rather than documenting an incompatibility.
// @force-gate !deploy
describe('404-page-router', () => { describe('404-page-router', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
...@@ -49,13 +52,6 @@ describe('404-page-router', () => { ...@@ -49,13 +52,6 @@ describe('404-page-router', () => {
(options) => { (options) => {
const isDev = (global as any).isNextDev const isDev = (global as any).isNextDev
if ((global as any).isNextDeploy) {
// TODO: investigate condensing these tests to avoid
// 5 separate deploys for this one test
it('should skip for deploy', () => {})
return
}
beforeAll(async () => { beforeAll(async () => {
// Only add in the middleware if we're testing with middleware enabled. // Only add in the middleware if we're testing with middleware enabled.
if (options.middleware) { if (options.middleware) {
......
import { nextTestSetup, isNextStart } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
;(process.env.TURBOPACK_DEV && isNextStart ? describe.skip : describe)( // TODO(deploy-test-completion): Assertions may differ from a local Next.js
'API routes', // server when deployed.
() => { // @force-gate !deploy
const { next, skipped } = nextTestSetup({ // @force-gate !start || !turbopackDev
describe('API routes', () => {
const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
}) })
if (skipped) return
it('should return data when catch-all', async () => { it('should return data when catch-all', async () => {
const data = await next const data = await next
...@@ -41,5 +40,4 @@ import { nextTestSetup, isNextStart } from 'e2e-utils' ...@@ -41,5 +40,4 @@ import { nextTestSetup, isNextStart } from 'e2e-utils'
expect(data).toEqual({}) expect(data).toEqual({})
}) })
} })
)
...@@ -6,17 +6,18 @@ import { ...@@ -6,17 +6,18 @@ import {
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import json from './big.json' import json from './big.json'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('API routes', () => { describe('API routes', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
'http-proxy': 'latest', 'http-proxy': 'latest',
cors: 'latest', cors: 'latest',
}, },
skipDeployment: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
if (skipped) return
it('should not strip .json from API route', async () => { it('should not strip .json from API route', async () => {
const res = await next.fetch('/api/hello.json') const res = await next.fetch('/api/hello.json')
...@@ -595,18 +596,19 @@ describe('API routes', () => { ...@@ -595,18 +596,19 @@ describe('API routes', () => {
} }
}) })
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('API routes output export error', () => { describe('API routes output export error', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
'http-proxy': 'latest', 'http-proxy': 'latest',
cors: 'latest', cors: 'latest',
}, },
skipStart: true, skipStart: true,
skipDeployment: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
if (skipped) return
it('should show error with output export', async () => { it('should show error with output export', async () => {
if (isNextDev) return if (isNextDev) return
......
...@@ -5,24 +5,19 @@ import { waitForNoRedbox, retry } from 'next-test-utils' ...@@ -5,24 +5,19 @@ import { waitForNoRedbox, retry } from 'next-test-utils'
// This is skipped when deployed because there are no assertions outside of next start/next dev // This is skipped when deployed because there are no assertions outside of next start/next dev
// @force-gate !deploy // @force-gate !deploy
describe('app dir', () => { describe('app dir', () => {
const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
if (isNextDeploy) { // @force-gate start
it('is excluded from deploy testing by @force-gate', () => {})
}
if (isNextStart) {
describe('Loading', () => { describe('Loading', () => {
it('should render loading.js in initial html for slow page', async () => { it('should render loading.js in initial html for slow page', async () => {
const $ = await next.render$('/page-with-loading') const $ = await next.render$('/page-with-loading')
expect($('#loading').text()).toBe('Loading...') expect($('#loading').text()).toBe('Loading...')
}) })
}) })
}
if (isNextDev) { // @force-gate dev
describe('HMR', () => { describe('HMR', () => {
it('should not cause error when removing loading.js', async () => { it('should not cause error when removing loading.js', async () => {
const browser = await next.browser('/page-with-loading') const browser = await next.browser('/page-with-loading')
...@@ -62,5 +57,4 @@ describe('app dir', () => { ...@@ -62,5 +57,4 @@ describe('app dir', () => {
) )
}) })
}) })
}
}) })
...@@ -10,6 +10,8 @@ import { ...@@ -10,6 +10,8 @@ import {
renderViaHTTP, renderViaHTTP,
} from 'next-test-utils' } from 'next-test-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('basePath', () => { describe('basePath', () => {
const basePath = '/docs' const basePath = '/docs'
...@@ -148,7 +150,7 @@ describe('basePath', () => { ...@@ -148,7 +150,7 @@ describe('basePath', () => {
}) })
if (!isNextDev) { if (!isNextDev) {
if (!isNextDeploy) { // @force-gate !deploy
it('should add basePath to routes-manifest', async () => { it('should add basePath to routes-manifest', async () => {
const routesManifest = JSON.parse( const routesManifest = JSON.parse(
await next.readFile('.next/routes-manifest.json') await next.readFile('.next/routes-manifest.json')
...@@ -156,6 +158,7 @@ describe('basePath', () => { ...@@ -156,6 +158,7 @@ describe('basePath', () => {
expect(routesManifest.basePath).toBe(basePath) expect(routesManifest.basePath).toBe(basePath)
}) })
// @force-gate !deploy
it('should prefetch pages correctly when manually called', async () => { it('should prefetch pages correctly when manually called', async () => {
const browser = await next.browser(`${basePath}/other-page`) const browser = await next.browser(`${basePath}/other-page`)
await browser.eval('window.next.router.prefetch("/gssp")') await browser.eval('window.next.router.prefetch("/gssp")')
...@@ -187,14 +190,13 @@ describe('basePath', () => { ...@@ -187,14 +190,13 @@ describe('basePath', () => {
}, true) }, true)
}) })
// @force-gate !deploy
it('should prefetch pages correctly in viewport with <Link>', async () => { it('should prefetch pages correctly in viewport with <Link>', async () => {
const browser = await next.browser(`${basePath}/hello`) const browser = await next.browser(`${basePath}/hello`)
await browser.eval('window.next.router.prefetch("/gssp")') await browser.eval('window.next.router.prefetch("/gssp")')
await check(async () => { await check(async () => {
const hrefs = await browser.eval( const hrefs = await browser.eval(`Object.keys(window.next.router.sdc)`)
`Object.keys(window.next.router.sdc)`
)
hrefs.sort() hrefs.sort()
assert.deepEqual( assert.deepEqual(
...@@ -233,7 +235,6 @@ describe('basePath', () => { ...@@ -233,7 +235,6 @@ describe('basePath', () => {
}, 'yes') }, 'yes')
}) })
} }
}
it('should serve public file with basePath correctly', async () => { it('should serve public file with basePath correctly', async () => {
const res = await fetchViaHTTP(next.url, `${basePath}/data.txt`) const res = await fetchViaHTTP(next.url, `${basePath}/data.txt`)
...@@ -402,7 +403,7 @@ describe('basePath', () => { ...@@ -402,7 +403,7 @@ describe('basePath', () => {
) )
}) })
if (!isNextDeploy) { // @force-gate !deploy
it('should navigate an absolute local url with basePath', async () => { it('should navigate an absolute local url with basePath', async () => {
const browser = await next.browser( const browser = await next.browser(
`${basePath}/absolute-url-basepath?port=${next.appPort}` `${basePath}/absolute-url-basepath?port=${next.appPort}`
...@@ -417,6 +418,7 @@ describe('basePath', () => { ...@@ -417,6 +418,7 @@ describe('basePath', () => {
expect(await browser.eval('window._didNotNavigate')).toBe(true) expect(await browser.eval('window._didNotNavigate')).toBe(true)
}) })
// @force-gate !deploy
it('should navigate an absolute local url without basePath', async () => { it('should navigate an absolute local url without basePath', async () => {
const browser = await next.browser( const browser = await next.browser(
`${basePath}/absolute-url-no-basepath?port=${next.appPort}` `${basePath}/absolute-url-no-basepath?port=${next.appPort}`
...@@ -430,7 +432,6 @@ describe('basePath', () => { ...@@ -430,7 +432,6 @@ describe('basePath', () => {
expect(text).toContain('Example Domain') expect(text).toContain('Example Domain')
}) })
}
it('should show the hello page under the /docs prefix', async () => { it('should show the hello page under the /docs prefix', async () => {
const browser = await next.browser(`${basePath}/hello`) const browser = await next.browser(`${basePath}/hello`)
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// Deploy mode exclusion: This suite aborts a raw client connection, but
// a hosting proxy changes cancellation propagation before Next.js receives it.
describe('streaming responses cancel inner stream after disconnect', () => { describe('streaming responses cancel inner stream after disconnect', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
......
...@@ -4,13 +4,13 @@ import { ...@@ -4,13 +4,13 @@ import {
getClientBuildManifestLoaderChunkUrlPath, getClientBuildManifestLoaderChunkUrlPath,
} from 'next-test-utils' } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('Client 404', () => { describe('Client 404', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
}) })
if (skipped) return
beforeAll(async () => { beforeAll(async () => {
// pre-build the home page so that navigating to it from the // pre-build the home page so that navigating to it from the
......
...@@ -8,18 +8,17 @@ import { ...@@ -8,18 +8,17 @@ import {
} from 'next-test-utils' } from 'next-test-utils'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Conflict between app file and pages file', () => { describe('Conflict between app file and pages file', () => {
const { next, isNextDev, isNextStart, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
skipStart: true, skipStart: true,
}) })
if (skipped) { // @force-gate start
return describe('production', () => {
}
if (isNextStart) {
it('should print error for conflicting app/page', async () => { it('should print error for conflicting app/page', async () => {
const { cliOutput } = await next.build() const { cliOutput } = await next.build()
if (process.env.IS_TURBOPACK_TEST) { if (process.env.IS_TURBOPACK_TEST) {
...@@ -45,7 +44,7 @@ describe('Conflict between app file and pages file', () => { ...@@ -45,7 +44,7 @@ describe('Conflict between app file and pages file', () => {
expect(cliOutput).not.toContain('/non-conflict-pages') expect(cliOutput).not.toContain('/non-conflict-pages')
expect(cliOutput).not.toContain('/non-conflict') expect(cliOutput).not.toContain('/non-conflict')
}) })
} })
async function containConflictsError(browser, conflicts) { async function containConflictsError(browser, conflicts) {
await retry(async () => { await retry(async () => {
...@@ -66,7 +65,8 @@ describe('Conflict between app file and pages file', () => { ...@@ -66,7 +65,8 @@ describe('Conflict between app file and pages file', () => {
}) })
} }
if (isNextDev) { // @force-gate dev
describe('development', () => {
it('should show error overlay for /another', async () => { it('should show error overlay for /another', async () => {
await next.start() await next.start()
const browser = await next.browser('/another') const browser = await next.browser('/another')
...@@ -123,5 +123,5 @@ describe('Conflict between app file and pages file', () => { ...@@ -123,5 +123,5 @@ describe('Conflict between app file and pages file', () => {
await waitForRedbox(browser) await waitForRedbox(browser)
await containConflictsError(browser, [['pages/index.js', 'app/page.js']]) await containConflictsError(browser, [['pages/index.js', 'app/page.js']])
}) })
} })
}) })
...@@ -4,17 +4,20 @@ import { retry } from 'next-test-utils' ...@@ -4,17 +4,20 @@ import { retry } from 'next-test-utils'
const customErrNo404Match = const customErrNo404Match =
/You have added a custom \/_error page without a custom \/404 page/ /You have added a custom \/_error page without a custom \/404 page/
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom _error', () => { describe('Custom _error', () => {
const { next, isNextDev, isNextStart } = 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,
}) })
if (isNextDev) { // @force-gate dev
describe('development', () => {
it('should not warn with /_error and /404 when rendering error first', async () => { it('should not warn with /_error and /404 when rendering error first', async () => {
const outputIndex = next.cliOutput.length const outputIndex = next.cliOutput.length
await next.patchFile('pages/404.js', 'export default <h1>') await next.patchFile('pages/404.js', 'export default <h1>')
...@@ -57,9 +60,10 @@ describe('Custom _error', () => { ...@@ -57,9 +60,10 @@ describe('Custom _error', () => {
expect(html).toContain('An error 404 occurred on server') expect(html).toContain('An error 404 occurred on server')
}) })
}) })
} })
if (isNextStart) { // @force-gate start
describe('production', () => {
it('should not contain /_error in build output', async () => { it('should not contain /_error in build output', async () => {
expect(next.cliOutput).toMatch(/ƒ .*?\/404/) expect(next.cliOutput).toMatch(/ƒ .*?\/404/)
expect(next.cliOutput).not.toMatch(/ƒ .*?\/_error/) expect(next.cliOutput).not.toMatch(/ƒ .*?\/_error/)
...@@ -69,5 +73,5 @@ describe('Custom _error', () => { ...@@ -69,5 +73,5 @@ describe('Custom _error', () => {
const html = await next.render('/') const html = await next.render('/')
expect(html).toMatch(/Custom error/) expect(html).toMatch(/Custom error/)
}) })
} })
}) })
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('Custom routes i18n with index redirect', () => { describe('Custom routes i18n with index redirect', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
}) })
if (skipped) return
it('should respond to default locale redirects correctly for index redirect', async () => { it('should respond to default locale redirects correctly for index redirect', async () => {
for (const [path, dest] of [ for (const [path, dest] of [
......
...@@ -3,13 +3,14 @@ import cheerio from 'cheerio' ...@@ -3,13 +3,14 @@ import cheerio from 'cheerio'
import { findPort, retry } from 'next-test-utils' import { findPort, retry } from 'next-test-utils'
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('Custom routes i18n', () => { describe('Custom routes i18n', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
let server: http.Server let server: http.Server
let externalPort: number let externalPort: number
......
...@@ -12,16 +12,17 @@ import { ...@@ -12,16 +12,17 @@ import {
fetchViaRawHttp, fetchViaRawHttp,
retry, retry,
} from 'next-test-utils' } from 'next-test-utils'
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom routes', () => { describe('Custom routes', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
skipDeployment: true,
}) })
if (skipped) return
let externalServerPort: number let externalServerPort: number
let externalServer: http.Server let externalServer: http.Server
...@@ -3473,16 +3474,17 @@ describe('Custom routes', () => { ...@@ -3473,16 +3474,17 @@ describe('Custom routes', () => {
}) })
} }
}) })
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom routes no-op rewrite', () => { describe('Custom routes no-op rewrite', () => {
const { next, isTurbopack, isNextStart, skipped } = nextTestSetup({ const { next, isTurbopack, isNextStart } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
env: { env: {
ADD_NOOP_REWRITE: 'true', ADD_NOOP_REWRITE: 'true',
}, },
skipDeployment: true,
}) })
if (skipped) return
if (isTurbopack && isNextStart) { if (isTurbopack && isNextStart) {
it('skipped - not supported in turbopack build mode', () => {}) it('skipped - not supported in turbopack build mode', () => {})
return return
...@@ -3530,14 +3532,15 @@ describe('Custom routes no-op rewrite', () => { ...@@ -3530,14 +3532,15 @@ describe('Custom routes no-op rewrite', () => {
}) })
}) })
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom routes solo types', () => { describe('Custom routes solo types', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
skipDeployment: true,
}) })
if (skipped) return
let externalServer: http.Server let externalServer: http.Server
let externalServerPort: number let externalServerPort: number
...@@ -3653,7 +3656,8 @@ describe('Custom routes solo types', () => { ...@@ -3653,7 +3656,8 @@ describe('Custom routes solo types', () => {
} }
}) })
}) })
;(isNextStart ? describe : describe.skip)('Custom routes export', () => { // @force-gate start
describe('Custom routes export', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
......
...@@ -113,16 +113,16 @@ async function waitForCallbackTimestampToStabilize( ...@@ -113,16 +113,16 @@ async function waitForCallbackTimestampToStabilize(
) )
} }
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('deferred-entries', () => { describe('deferred-entries', () => {
const { next, isNextStart, skipped } = nextTestSetup({ const { next, isNextStart } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
skipStart: true, skipStart: true,
dependencies: {}, dependencies: {},
}) })
if (skipped) return
beforeAll(async () => { beforeAll(async () => {
// Clear log files before starting // Clear log files before starting
const entryLogPath = path.join(next.testDir, '.entry-log') const entryLogPath = path.join(next.testDir, '.entry-log')
......
...@@ -16,15 +16,12 @@ function getData(html: string) { ...@@ -16,15 +16,12 @@ function getData(html: string) {
// It likely expects a local build failure instead of a successful deployment. // It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy // @force-gate !deploy
describe('Test Draft Mode', () => { describe('Test Draft Mode', () => {
const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
if (isNextDeploy) { // @force-gate dev
it('is excluded from deploy testing by @force-gate', () => {}) describe('development', () => {
}
if (isNextDev) {
it('should start development application', async () => { it('should start development application', async () => {
const html = await next.render('/') const html = await next.render('/')
expect(html).toBeTruthy() expect(html).toBeTruthy()
...@@ -93,9 +90,10 @@ describe('Test Draft Mode', () => { ...@@ -93,9 +90,10 @@ describe('Test Draft Mode', () => {
const setCookie = res.headers.get('set-cookie') const setCookie = res.headers.get('set-cookie')
expect(setCookie).toBeTruthy() expect(setCookie).toBeTruthy()
}) })
} })
if (isNextStart) { // @force-gate start
describe('production', () => {
let cookieString: string let cookieString: string
let initialRand: string let initialRand: string
const getOpts = () => ({ headers: { Cookie: cookieString } }) const getOpts = () => ({ headers: { Cookie: cookieString } })
...@@ -216,5 +214,5 @@ describe('Test Draft Mode', () => { ...@@ -216,5 +214,5 @@ describe('Test Draft Mode', () => {
draftMode: true, draftMode: true,
}) })
}) })
} })
}) })
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import { runTests } from './shared' import { runTests } from './shared'
// Deploy mode exclusion: The assertions exercise behavior specific to the local Next.js server.
// Some assertions (`should not decode slashes`, `should serve file with
// plus from public/static folder`) depend on local Next.js URL handling
// and don't apply to Vercel's deploy infrastructure.
// @force-gate !deploy
describe('Dynamic Routing', () => { describe('Dynamic Routing', () => {
const { next, isTurbopack, skipped } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
// Some assertions (`should not decode slashes`, `should serve file with
// plus from public/static folder`) depend on local Next.js URL handling
// and don't apply to Vercel's deploy infrastructure.
skipDeployment: true,
}) })
if (skipped) return
runTests({ next, isNextDev, isTurbopack, middlewareEnabled: false }) runTests({ next, isNextDev, isTurbopack, middlewareEnabled: false })
}) })
...@@ -3,21 +3,21 @@ import cheerio from 'cheerio' ...@@ -3,21 +3,21 @@ import cheerio from 'cheerio'
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import { findPort } from 'next-test-utils' import { findPort } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode.
// @force-gate !deploy
describe('Fetch polyfill', () => { describe('Fetch polyfill', () => {
let apiServerPort: number let apiServerPort: number
let apiServer: http.Server let apiServer: http.Server
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
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',
}, },
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode.
skipDeployment: true,
}) })
if (skipped) return
beforeAll(async () => { beforeAll(async () => {
apiServerPort = await findPort() apiServerPort = await findPort()
......
...@@ -15,13 +15,13 @@ function getData(html: string) { ...@@ -15,13 +15,13 @@ function getData(html: string) {
} }
} }
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('ServerSide Props Preview Mode', () => { describe('ServerSide Props Preview Mode', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
}) })
if (skipped) return
if (isNextStart) { if (isNextStart) {
it('should compile successfully', async () => { it('should compile successfully', async () => {
......
...@@ -2,13 +2,11 @@ import { join } from 'path' ...@@ -2,13 +2,11 @@ import { join } from 'path'
import { FileRef, nextTestSetup } from 'e2e-utils' import { FileRef, nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils' import { check } from 'next-test-utils'
// TODO: investigate tests failures on deploy
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// The source only records that these assertions fail after deployment; the root cause is unknown.
// @force-gate !deploy
describe('i18n-data-fetching-redirect', () => { describe('i18n-data-fetching-redirect', () => {
// TODO: investigate tests failures on deploy
if ((global as any).isNextDeploy) {
it('should skip temporarily', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
pages: new FileRef(join(__dirname, 'app/pages')), pages: new FileRef(join(__dirname, 'app/pages')),
......
...@@ -12,20 +12,19 @@ function checkDataRoute(data: any, page: string) { ...@@ -12,20 +12,19 @@ function checkDataRoute(data: any, page: string) {
expect(data.pageProps).toHaveProperty('page', page) expect(data.pageProps).toHaveProperty('page', page)
} }
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// This test skips deployment because env vars that are doubled underscore prefixed
// are not supported.
// @force-gate !deploy
describe('i18n-data-route', () => { describe('i18n-data-route', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// This test skips deployment because env vars that are doubled underscore prefixed
// are not supported.
skipDeployment: true,
env: { env: {
// Disable internal header stripping so we can test the invoke output. // Disable internal header stripping so we can test the invoke output.
__NEXT_NO_STRIP_INTERNAL_HEADERS: '1', __NEXT_NO_STRIP_INTERNAL_HEADERS: '1',
}, },
}) })
if (skipped) return
describe('with locale prefix', () => { describe('with locale prefix', () => {
describe.each(i18n.locales)('/%s', (locale) => { describe.each(i18n.locales)('/%s', (locale) => {
const prefixed = pages.map((page) => ({ const prefixed = pages.map((page) => ({
......
...@@ -13,17 +13,14 @@ async function verify(res, locale) { ...@@ -13,17 +13,14 @@ async function verify(res, locale) {
expect($('#router-locale').text()).toBe(locale) expect($('#router-locale').text()).toBe(locale)
} }
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// TODO: re-enable after this behavior is corrected
// @force-gate !deploy
describe('i18n-disallow-multiple-locales', () => { describe('i18n-disallow-multiple-locales', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// TODO: re-enable after this behavior is corrected
skipDeployment: true,
}) })
if (skipped) {
return
}
it('should verify the default locale works', async () => { it('should verify the default locale works', async () => {
const res = await next.fetch('/', { redirect: 'manual' }) const res = await next.fetch('/', { redirect: 'manual' })
......
...@@ -7,13 +7,14 @@ import { nextTestSetup, isNextDev, type NextInstance } from 'e2e-utils' ...@@ -7,13 +7,14 @@ import { nextTestSetup, isNextDev, type NextInstance } from 'e2e-utils'
type BrowserOptions = Parameters<NextInstance['browser']>[1] type BrowserOptions = Parameters<NextInstance['browser']>[1]
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('i18n Support basePath', () => { describe('i18n Support basePath', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
const ctx: Record<string, any> = { const ctx: Record<string, any> = {
basePath: '/docs', basePath: '/docs',
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('Custom routes i18n custom error', () => { describe('Custom routes i18n custom error', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
}) })
if (skipped) return
const locales = ['en', 'fr', 'de', 'it'] const locales = ['en', 'fr', 'de', 'it']
......
...@@ -9,13 +9,14 @@ import assert from 'assert' ...@@ -9,13 +9,14 @@ import assert from 'assert'
type BrowserOptions = Parameters<NextInstance['browser']>[1] type BrowserOptions = Parameters<NextInstance['browser']>[1]
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('i18n Support', () => { describe('i18n Support', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
const ctx: Record<string, any> = { const ctx: Record<string, any> = {
basePath: '', basePath: '',
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Vercel's deploy infrastructure normalizes nested `/index/index/index`
// paths differently from Next.js's local server, so the routing
// assertions here are local-only.
// @force-gate !deploy
describe('nested index.js', () => { describe('nested index.js', () => {
const { next, isTurbopack, skipped } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
// Vercel's deploy infrastructure normalizes nested `/index/index/index`
// paths differently from Next.js's local server, so the routing
// assertions here are local-only.
skipDeployment: true,
}) })
if (skipped) return
it('should ssr page /', async () => { it('should ssr page /', async () => {
const $ = await next.render$('/') const $ = await next.render$('/')
......
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Errors on invalid custom routes', () => { describe('Errors on invalid custom routes', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
const writeConfig = async (routes: any, type = 'redirects') => { const writeConfig = async (routes: any, type = 'redirects') => {
await next.patchFile( await next.patchFile(
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// Deploy mode exclusion: This suite asserts local CLI or runtime logs that deployments do not expose.
// The test asserts on `next.cliOutput`, expecting the local
// `next build` failure message ("To use a multi-match in the
// destination..."). In deploy mode `next.cliOutput` contains the
// Vercel deploy log, which doesn't surface the same Next.js build
// error string at the top level, so the assertions don't apply.
// @force-gate !deploy
describe('Custom routes invalid multi-match', () => { describe('Custom routes invalid multi-match', () => {
const { next, isNextDeploy, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
// The test asserts on `next.cliOutput`, expecting the local
// `next build` failure message ("To use a multi-match in the
// destination..."). In deploy mode `next.cliOutput` contains the
// Vercel deploy log, which doesn't surface the same Next.js build
// error string at the top level, so the assertions don't apply.
skipDeployment: true,
}) })
if (skipped) return
if (isNextDeploy) return
it('should show error for invalid multi-match', async () => { it('should show error for invalid multi-match', async () => {
await next.render('/random') await next.render('/random')
......
...@@ -4,12 +4,13 @@ import { getDeterministicOutput } from '../app-dir/cache-components-errors/utils ...@@ -4,12 +4,13 @@ import { getDeterministicOutput } from '../app-dir/cache-components-errors/utils
const partialPrefetching = !!process.env.__NEXT_PARTIAL_PREFETCHING const partialPrefetching = !!process.env.__NEXT_PARTIAL_PREFETCHING
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Validations for <Link legacyBehavior>', () => { describe('Validations for <Link legacyBehavior>', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) return
let previousOutputIndex = 0 let previousOutputIndex = 0
beforeEach(() => { beforeEach(() => {
......
...@@ -5,12 +5,9 @@ import http from 'http' ...@@ -5,12 +5,9 @@ import http from 'http'
import assert from 'assert' import assert from 'assert'
import { check, renderViaHTTP, waitFor } from 'next-test-utils' import { check, renderViaHTTP, waitFor } from 'next-test-utils'
// Deploy mode exclusion: This suite runs an in-test HTTP proxy in front of the local Next.js server.
// @force-gate !deploy
describe('manual-client-base-path', () => { describe('manual-client-base-path', () => {
if ((global as any).isNextDeploy) {
it('should skip deploy', () => {})
return
}
let server: http.Server let server: http.Server
let appPort: string let appPort: string
const basePath = '/docs-proxy' const basePath = '/docs-proxy'
......
...@@ -2,10 +2,12 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,10 +2,12 @@ import { nextTestSetup } from 'e2e-utils'
import { check, waitFor } from 'next-test-utils' import { check, waitFor } from 'next-test-utils'
import path from 'path' import path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('multi-zone', () => { describe('multi-zone', () => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: path.join(__dirname, 'app'), files: path.join(__dirname, 'app'),
skipDeployment: true,
buildCommand: 'pnpm build', buildCommand: 'pnpm build',
startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start', startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start',
serverReadyPattern: /Next mode: (production|development)/, serverReadyPattern: /Next mode: (production|development)/,
...@@ -20,10 +22,6 @@ describe('multi-zone', () => { ...@@ -20,10 +22,6 @@ describe('multi-zone', () => {
dependencies: require('./app/package.json').dependencies, dependencies: require('./app/package.json').dependencies,
}) })
if (skipped) {
return
}
it.each([ it.each([
{ pathname: '/', content: ['hello from host app'] }, { pathname: '/', content: ['hello from host app'] },
{ pathname: '/guest', content: ['hello from guest app'] }, { pathname: '/guest', content: ['hello from guest app'] },
......
...@@ -3,6 +3,8 @@ import path from 'path' ...@@ -3,6 +3,8 @@ import path from 'path'
const appDir = path.join(__dirname, 'material-ui') const appDir = path.join(__dirname, 'material-ui')
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('New Link Behavior with material-ui', () => { describe('New Link Behavior with material-ui', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
......
...@@ -3,6 +3,8 @@ import path from 'path' ...@@ -3,6 +3,8 @@ import path from 'path'
const appDir = path.join(__dirname, 'stitches') const appDir = path.join(__dirname, 'stitches')
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('New Link Behavior with stitches', () => { describe('New Link Behavior with stitches', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// This test is skipped when deployed because it asserts against runtime
// logs that cannot be queried in a deployed environment.
// @force-gate !deploy
describe('next-phase', () => { describe('next-phase', () => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
// This test is skipped when deployed because it asserts against runtime
// logs that cannot be queried in a deployed environment.
skipDeployment: true,
files: { files: {
'app/layout.js': `export default function Layout({ children }) { 'app/layout.js': `export default function Layout({ children }) {
return <html><body>{children}</body></html> return <html><body>{children}</body></html>
...@@ -20,8 +21,6 @@ describe('next-phase', () => { ...@@ -20,8 +21,6 @@ describe('next-phase', () => {
}, },
}) })
if (skipped) return
it('should render page with next phase correctly', async () => { it('should render page with next phase correctly', async () => {
await next.fetch('/') await next.fetch('/')
await next.fetch('/foo') await next.fetch('/foo')
......
import { nextTestSetup, type Playwright } from 'e2e-utils' import { nextTestSetup, type Playwright } from 'e2e-utils'
import { check } from 'next-test-utils' import { check } from 'next-test-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('beforeInteractive in document Head', () => { describe('beforeInteractive in document Head', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
......
...@@ -4,14 +4,14 @@ import { randomUUID } from 'crypto' ...@@ -4,14 +4,14 @@ import { randomUUID } from 'crypto'
import fs from 'fs-extra' import fs from 'fs-extra'
import { join } from 'path' import { join } from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy || !standaloneOutput
describe('og-api', () => { describe('og-api', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(join(__dirname, 'app')), files: new FileRef(join(__dirname, 'app')),
skipDeployment: process.env.TEST_OUTPUT_STANDALONE === 'true',
}) })
if (skipped) return
it('should respond from index', async () => { it('should respond from index', async () => {
const html = await renderViaHTTP(next.url, '/') const html = await renderViaHTTP(next.url, '/')
expect(html).toContain('hello world') expect(html).toContain('hello world')
......
...@@ -35,21 +35,14 @@ export const config = { ...@@ -35,21 +35,14 @@ export const config = {
} }
describe('react-current-version', () => { describe('react-current-version', () => {
// This block asserts local build and server CLI output.
// @force-gate !deploy
describe('React 18 deprecation warning', () => { describe('React 18 deprecation warning', () => {
const { next, isNextDeploy, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: join(__dirname, 'app'), files: join(__dirname, 'app'),
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
if (isNextDeploy) {
it('should skip in deploy mode', () => {})
return
}
if (isNextDev) { if (isNextDev) {
it('warns during next dev only when using React 18', async () => { it('warns during next dev only when using React 18', async () => {
await next.start() await next.start()
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('react-dnd-compile', () => { describe('react-dnd-compile', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
fetchViaRawHttp, fetchViaRawHttp,
retry, retry,
} from 'next-test-utils' } from 'next-test-utils'
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
function runTests({ function runTests({
next, next,
...@@ -421,21 +421,22 @@ function runTests({ ...@@ -421,21 +421,22 @@ function runTests({
describe('404 handling', () => { describe('404 handling', () => {
describe('custom _error', () => { describe('custom _error', () => {
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('server mode', () => { describe('server mode', () => {
const { next, isNextDeploy } = nextTestSetup({ const { next } = nextTestSetup({
files: path.join(__dirname, 'app'), files: path.join(__dirname, 'app'),
skipDeployment: true,
}) })
if (isNextDeploy) return
runTests({ next, isDev: isNextDev, isPages404: false }) runTests({ next, isDev: isNextDev, isPages404: false })
}) })
;(isNextStart ? describe : describe.skip)('export mode', () => { // @force-gate start
const { next, skipped } = nextTestSetup({ describe('export mode', () => {
const { next } = nextTestSetup({
files: path.join(__dirname, 'app'), files: path.join(__dirname, 'app'),
skipStart: true, skipStart: true,
}) })
if (skipped) return
let staticServer: any let staticServer: any
let staticPort: number let staticPort: number
...@@ -473,13 +474,14 @@ describe('404 handling', () => { ...@@ -473,13 +474,14 @@ describe('404 handling', () => {
}) })
describe('pages/404', () => { describe('pages/404', () => {
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('server mode', () => { describe('server mode', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: path.join(__dirname, 'app'), files: path.join(__dirname, 'app'),
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
beforeAll(async () => { beforeAll(async () => {
await next.deleteFile('pages/_error.js') await next.deleteFile('pages/_error.js')
...@@ -503,12 +505,12 @@ describe('404 handling', () => { ...@@ -503,12 +505,12 @@ describe('404 handling', () => {
runTests({ next, isDev: isNextDev, isPages404: true }) runTests({ next, isDev: isNextDev, isPages404: true })
}) })
;(isNextStart ? describe : describe.skip)('pages/404 export mode', () => { // @force-gate start
const { next, skipped } = nextTestSetup({ describe('pages/404 export mode', () => {
const { next } = nextTestSetup({
files: path.join(__dirname, 'app'), files: path.join(__dirname, 'app'),
skipStart: true, skipStart: true,
}) })
if (skipped) return
let staticServer: any let staticServer: any
let staticPort: number let staticPort: number
......
...@@ -3,12 +3,9 @@ import http from 'http' ...@@ -3,12 +3,9 @@ import http from 'http'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { findPort, retry } from 'next-test-utils' import { findPort, retry } from 'next-test-utils'
// Deploy mode exclusion: This suite opens raw TCP connections to a local backend server.
// @force-gate !deploy
describe('rewrite-request-smuggling', () => { describe('rewrite-request-smuggling', () => {
if ((global as any).isNextDeploy) {
it('should skip deploy', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
......
...@@ -2,17 +2,15 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,17 +2,15 @@ import { nextTestSetup } from 'e2e-utils'
import { findPort } from 'next-test-utils' import { findPort } from 'next-test-utils'
import createTargetServer from './target-server' import createTargetServer from './target-server'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely depends on a local server, proxy, process, or dynamically allocated port.
// @force-gate !deploy
describe('rewrites hostname', () => { describe('rewrites hostname', () => {
const { skipped, next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
let targetPort: number | null = null let targetPort: number | null = null
let closeTargetServer: (() => Promise<void>) | null = null let closeTargetServer: (() => Promise<void>) | null = null
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
// @force-gate !deploy
describe('Route index handling', () => { describe('Route index handling', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
skipDeployment: true,
}) })
it('should handle / correctly', async () => { it('should handle / correctly', async () => {
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
// @force-gate !deploy
describe('Route indexes handling', () => { describe('Route indexes handling', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
skipDeployment: true,
}) })
it('should handle / correctly', async () => { it('should handle / correctly', async () => {
......
...@@ -11,6 +11,8 @@ import { ...@@ -11,6 +11,8 @@ import {
import { join } from 'path' import { join } from 'path'
import cheerio from 'cheerio' import cheerio from 'cheerio'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('skip-trailing-slash-redirect', () => { describe('skip-trailing-slash-redirect', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(join(__dirname, 'app')), files: new FileRef(join(__dirname, 'app')),
......
...@@ -28,15 +28,12 @@ async function testRoute(appPort, url, { isStatic, isEdge }) { ...@@ -28,15 +28,12 @@ async function testRoute(appPort, url, { isStatic, isEdge }) {
} }
} }
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Prerenders used by this suite are not currently handled by deploy mode.
// @force-gate !deploy
describe('Switchable runtime', () => { describe('Switchable runtime', () => {
let context let context
if ((global as any).isNextDeploy) {
// TODO-APP: re-enable after Prerenders are handled on deploy
it('should skip for deploy temporarily', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(__dirname), files: new FileRef(__dirname),
}) })
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { waitFor } from 'next-test-utils' import { waitFor } from 'next-test-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('@next/third-parties basic usage', () => { describe('@next/third-parties basic usage', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
......
...@@ -2,15 +2,15 @@ import { join } from 'path' ...@@ -2,15 +2,15 @@ import { join } from 'path'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { findPort, initNextServerScript, killApp } from 'next-test-utils' import { findPort, initNextServerScript, killApp } from 'next-test-utils'
// Deploy mode exclusion: This suite controls a local server or proxy process.
// Spawns a custom proxy server in front of `next.start()`; deploy mode
// doesn't run a local server.
// @force-gate !deploy
describe('Trailing Slash Rewrite Proxying', () => { describe('Trailing Slash Rewrite Proxying', () => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
// Spawns a custom proxy server in front of `next.start()`; deploy mode
// doesn't run a local server.
skipDeployment: true,
}) })
if (skipped) return
let proxyServer: any let proxyServer: any
......
...@@ -2,12 +2,10 @@ import { join } from 'path' ...@@ -2,12 +2,10 @@ import { join } from 'path'
import { FileRef, nextTestSetup } from 'e2e-utils' import { FileRef, nextTestSetup } from 'e2e-utils'
import { fetchViaHTTP } from 'next-test-utils' import { fetchViaHTTP } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
// @force-gate !deploy
describe('trailingSlash:true with rewrites and getStaticProps', () => { describe('trailingSlash:true with rewrites and getStaticProps', () => {
if ((global as any).isNextDeploy) {
it('should skip for deploy mode for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(join(__dirname, './app')), files: new FileRef(join(__dirname, './app')),
}) })
......
...@@ -8,9 +8,11 @@ import { FileRef, nextTestSetup, isNextDev } from 'e2e-utils' ...@@ -8,9 +8,11 @@ import { FileRef, nextTestSetup, isNextDev } from 'e2e-utils'
import { join } from 'path' import { join } from 'path'
// experimental.urlImports is not implemented in Turbopack // experimental.urlImports is not implemented in Turbopack
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)( // Deploy mode exclusion: This suite controls a local server or proxy process.
`Handle url imports`, // The staticServer above doesn't work when deployed
() => { // @force-gate !deploy
// @force-gate !turbopack
describe(`Handle url imports`, () => {
let staticServer let staticServer
let staticServerPort let staticServerPort
beforeAll(async () => { beforeAll(async () => {
...@@ -25,7 +27,7 @@ import { join } from 'path' ...@@ -25,7 +27,7 @@ import { join } from 'path'
await stopApp(staticServer) await stopApp(staticServer)
}) })
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: isNextDev files: isNextDev
? { ? {
// exclude next.lock here, should be generated automatically in dev // exclude next.lock here, should be generated automatically in dev
...@@ -34,14 +36,8 @@ import { join } from 'path' ...@@ -34,14 +36,8 @@ import { join } from 'path'
public: new FileRef(join(__dirname, 'public')), public: new FileRef(join(__dirname, 'public')),
} }
: __dirname, : __dirname,
// The staticServer above doesn't work when deployed
skipDeployment: true,
}) })
if (skipped) {
return
}
const expectedServer = const expectedServer =
/Hello <!-- -->42<!-- -->\+<!-- -->42<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png/ /Hello <!-- -->42<!-- -->\+<!-- -->42<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png/
const expectedClient = new RegExp( const expectedClient = new RegExp(
...@@ -96,5 +92,4 @@ import { join } from 'path' ...@@ -96,5 +92,4 @@ import { join } from 'path'
expect(data).toEqual({ value: 42 }) expect(data).toEqual({ value: 42 })
}) })
} })
)
...@@ -10,21 +10,19 @@ import { isNextDev, isNextStart, nextTestSetup } from 'e2e-utils' ...@@ -10,21 +10,19 @@ import { isNextDev, isNextStart, nextTestSetup } from 'e2e-utils'
// Webpack has // Webpack has
// - a bug where App Router API routes (and Metadata) return client assets for `new URL`s. // - a bug where App Router API routes (and Metadata) return client assets for `new URL`s.
// - a bug where Edge Page routes return client assets for `new URL`s. // - a bug where Edge Page routes return client assets for `new URL`s.
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
// @force-gate !deploy
describe(`Handle new URL asset references`, () => { describe(`Handle new URL asset references`, () => {
const { next, skipped, isTurbopack } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
env: { env: {
// rely on skew protection when deployed // rely on skew protection when deployed
NEXT_DEPLOYMENT_ID: isNextStart ? 'test-deployment-id' : undefined, NEXT_DEPLOYMENT_ID: isNextStart ? 'test-deployment-id' : undefined,
__NEXT_SUPPORTS_IMMUTABLE_ASSETS: isNextStart ? '1' : undefined, __NEXT_SUPPORTS_IMMUTABLE_ASSETS: isNextStart ? '1' : undefined,
}, },
skipDeployment: true,
}) })
if (skipped) {
return
}
const serverFileRegex = expect.stringMatching( const serverFileRegex = expect.stringMatching(
/file:.*\/.next(\/dev)?\/server\/.*\/vercel.HASH.png$/ /file:.*\/.next(\/dev)?\/server\/.*\/vercel.HASH.png$/
) )
......
...@@ -2,10 +2,12 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,10 +2,12 @@ import { nextTestSetup } from 'e2e-utils'
import { expectVaryHeaderToContain } from 'next-test-utils' import { expectVaryHeaderToContain } from 'next-test-utils'
import path from 'path' import path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
// @force-gate !deploy
describe('Vary Header Tests', () => { describe('Vary Header Tests', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: path.join(__dirname, '../app'), files: path.join(__dirname, '../app'),
skipDeployment: true,
}) })
it('should preserve custom vary header in API routes', async () => { it('should preserve custom vary header in API routes', 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