Unverified Commit cfa2956c authored by Josh Story's avatar Josh Story Committed by GitHub

test: migrate tooling deploy exclusions to force gates (#98156)

## Summary

Migrate the remaining configuration, TypeScript, bundler, compiler,
loader, export, and monorepo 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 workspace/root-inference files covered by #99012 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.
- Gate unit tests: 78 passed.
- 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 -->
parent 6a8cec78
import { isNextDev, nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// This test exercises `next build` outputs and `next start` behaviour, so it // This test exercises `next build` outputs and `next start` behaviour, so it
// is meaningless in dev mode where the dev server bypasses production build // is meaningless in dev mode where the dev server bypasses production build
// artifacts (e.g. statically prerendered 500.html from getStaticProps). // artifacts (e.g. statically prerendered 500.html from getStaticProps).
;(isNextDev ? describe.skip : describe)('500 Page build validation', () => { // TODO(deploy-test-completion): Re-enable this suite in deploy mode.
const { next, skipped } = nextTestSetup({ // It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
// @force-gate !dev
describe('500 Page build validation', () => {
const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
const gip500Err = const gip500Err =
/`pages\/500` can not have getInitialProps\/getServerSideProps/ /`pages\/500` can not have getInitialProps\/getServerSideProps/
......
import { isNextDev } from 'e2e-utils' import { isNextDev } from 'e2e-utils'
import { runTests } from './utils' import { runTests } from './utils'
// These cases patch fixture files and manually run local builds.
// @force-gate !deploy
describe('app dir - with output export - dynamic missing gsp', () => { describe('app dir - with output export - dynamic missing gsp', () => {
describe('should error when dynamic route is missing generateStaticParams', () => { describe('should error when dynamic route is missing generateStaticParams', () => {
runTests({ runTests({
......
import { runTests } from './utils' import { runTests } from './utils'
// These cases patch fixture files and manually run local builds.
// @force-gate !deploy
describe('app dir - with output export - dynamic api route', () => { describe('app dir - with output export - dynamic api route', () => {
describe.each([ describe.each([
{ {
......
import { runTests } from './utils' import { runTests } from './utils'
// These cases patch fixture files and manually run local builds.
// @force-gate !deploy
describe('app dir - with output export - dynamic api route', () => { describe('app dir - with output export - dynamic api route', () => {
describe.each([ describe.each([
{ dynamicPage: 'undefined' }, { dynamicPage: 'undefined' },
......
import { runTests } from './utils' import { runTests } from './utils'
// These cases patch fixture files and manually run local builds.
// @force-gate !deploy
describe('app dir - with output export - trailing slash', () => { describe('app dir - with output export - trailing slash', () => {
describe.each([{ trailingSlash: false }, { trailingSlash: true }])( describe.each([{ trailingSlash: false }, { trailingSlash: true }])(
"should work in prod with trailingSlash '$trailingSlash'", "should work in prod with trailingSlash '$trailingSlash'",
......
...@@ -227,15 +227,11 @@ export function runTests({ ...@@ -227,15 +227,11 @@ export function runTests({
| 'set wrong param' | 'set wrong param'
expectedErrMsg?: string | RegExp expectedErrMsg?: string | RegExp
}) { }) {
let { next, skipped, isNextDev } = nextTestSetup({ let { next, isNextDev } = nextTestSetup({
files: join(__dirname, '..'), files: join(__dirname, '..'),
skipDeployment: true,
skipStart: true, skipStart: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
if (skipped) {
return
}
beforeAll(async () => { beforeAll(async () => {
if (trailingSlash !== undefined) { if (trailingSlash !== undefined) {
......
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('app-dir action handling - next export', () => { describe('app-dir action handling - next export', () => {
const { next, isNextStart, skipped } = nextTestSetup({ const { next, isNextStart } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
dependencies: { dependencies: {
nanoid: '4.0.1', nanoid: '4.0.1',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })
if (skipped) return
if (!isNextStart) { if (!isNextStart) {
it('skip test for development mode', () => {}) it('skip test for development mode', () => {})
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { waitForNoRedbox, retry } from 'next-test-utils' import { waitForNoRedbox, retry } from 'next-test-utils'
// Deploy mode exclusion: This suite only defines assertions for local dev or start modes.
// This is skipped when deployed because there are no assertions outside of next start/next dev
// @force-gate !deploy
describe('app dir', () => { describe('app dir', () => {
const { next, isNextDev, isNextStart, skipped } = nextTestSetup({ const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({
files: __dirname, files: __dirname,
// This is skipped when deployed because there are no assertions outside of next start/next dev
skipDeployment: true,
}) })
if (skipped) return if (isNextDeploy) {
it('is excluded from deploy testing by @force-gate', () => {})
}
if (isNextStart) { if (isNextStart) {
describe('Loading', () => { describe('Loading', () => {
......
...@@ -34,10 +34,11 @@ if (!isNextStart) { ...@@ -34,10 +34,11 @@ if (!isNextStart) {
}) })
} else { } else {
describe('app dir - unset crossOrigin config', () => { describe('app dir - unset crossOrigin config', () => {
// Deploy mode exclusion: This branch only runs in next start mode.
// @force-gate !deploy
describe('default output', () => { describe('default output', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: path.join(__dirname, 'default'), files: path.join(__dirname, 'default'),
skipDeployment: true,
}) })
function expectCrossOriginAttributesToBeOmitted( function expectCrossOriginAttributesToBeOmitted(
...@@ -61,6 +62,9 @@ if (!isNextStart) { ...@@ -61,6 +62,9 @@ if (!isNextStart) {
}) })
if (process.env.__NEXT_CACHE_COMPONENTS !== 'true') { if (process.env.__NEXT_CACHE_COMPONENTS !== 'true') {
// Deploy mode exclusion: This test builds and starts the exported app
// through a local custom server.
// @force-gate !deploy
describe('output: export', () => { describe('output: export', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: path.join(__dirname, 'default'), files: path.join(__dirname, 'default'),
...@@ -68,7 +72,6 @@ if (!isNextStart) { ...@@ -68,7 +72,6 @@ if (!isNextStart) {
NEXT_TEST_OUTPUT_EXPORT: '1', NEXT_TEST_OUTPUT_EXPORT: '1',
}, },
skipStart: true, skipStart: true,
skipDeployment: true,
startCommand: 'node server.mjs', startCommand: 'node server.mjs',
serverReadyPattern: /- Local:/, serverReadyPattern: /- Local:/,
}) })
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely inspects local build artifacts that deploy tests do not expose.
// @force-gate !deploy
describe('app-dir - bun externals', () => { describe('app-dir - bun externals', () => {
const { next, isNextDev, isTurbopack, skipped } = nextTestSetup({ const { next, isNextDev, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) {
return
}
it('should handle bun builtins as external modules', async () => { it('should handle bun builtins as external modules', async () => {
const $ = await next.render$('/') const $ = await next.render$('/')
......
...@@ -7,8 +7,11 @@ import { ...@@ -7,8 +7,11 @@ import {
} from 'next-test-utils' } from 'next-test-utils'
import * as path from 'path' import * as path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely controls the local Next.js build or server lifecycle.
// @force-gate !deploy
describe('non-root-project-monorepo', () => { describe('non-root-project-monorepo', () => {
const { next, skipped, isTurbopack, isNextDev, isRspack } = nextTestSetup({ const { next, isTurbopack, isNextDev, isRspack } = nextTestSetup({
files: { files: {
apps: new FileRef(path.resolve(__dirname, 'apps')), apps: new FileRef(path.resolve(__dirname, 'apps')),
packages: new FileRef(path.resolve(__dirname, 'packages')), packages: new FileRef(path.resolve(__dirname, 'packages')),
...@@ -24,13 +27,8 @@ describe('non-root-project-monorepo', () => { ...@@ -24,13 +27,8 @@ 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',
skipDeployment: true,
}) })
if (skipped) {
return
}
describe('server relative import', () => { describe('server relative import', () => {
it('should resolve a `/`-rooted import from the project directory, not the workspace root', async () => { it('should resolve a `/`-rooted import from the project directory, not the workspace root', async () => {
// `/content/where` exists both in apps/web (the project directory) and at // `/content/where` exists both in apps/web (the project directory) and at
......
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 controls the local Next.js build or server lifecycle.
// @force-gate !deploy
describe('nx-handling', () => { describe('nx-handling', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
skipDeployment: true,
files: __dirname, files: __dirname,
buildCommand: 'pnpm run build', buildCommand: 'pnpm run build',
startCommand: isNextDev ? 'pnpm run dev' : 'pnpm run start', startCommand: isNextDev ? 'pnpm run dev' : 'pnpm run start',
......
...@@ -15,17 +15,15 @@ To fix it: ...@@ -15,17 +15,15 @@ To fix it:
Learn more: https://nextjs.org/docs/messages/middleware-to-proxy` Learn more: https://nextjs.org/docs/messages/middleware-to-proxy`
// 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('proxy-missing-export', () => { describe('proxy-missing-export', () => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
it('should error when proxy file has invalid export named middleware', async () => { it('should error when proxy file has invalid export named middleware', async () => {
await writeFile( await writeFile(
join(next.testDir, 'proxy.ts'), join(next.testDir, 'proxy.ts'),
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// Skip as Turbopack doesn't support the `!=!` Webpack syntax // Skip as Turbopack doesn't support the `!=!` Webpack syntax
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)( ;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
'app dir - rsc webpack loader', 'app dir - rsc webpack loader',
() => { () => {
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import path from 'path' import path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// This test is skipped when deployed because the local tarball appears corrupted
// It also doesn't seem particularly useful to test when deployed
// @force-gate !deploy
describe('self-importing-package', () => { describe('self-importing-package', () => {
const { next } = 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: {
'internal-pkg': `file:${path.join(__dirname, 'internal-pkg.tar')}`, 'internal-pkg': `file:${path.join(__dirname, 'internal-pkg.tar')}`,
}, },
......
import path from 'path' import path from 'path'
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
// Deploy mode exclusion: This suite manually changes the local `node_modules` tree.
// This test is skipped when deployed because it relies on manually patched `node_modules`
// @force-gate !deploy
describe('app-dir - server components externals', () => { describe('app-dir - server components externals', () => {
const { next, isTurbopack, skipped } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
// This test is skipped when deployed because it relies on manually patched `node_modules`
skipDeployment: true,
files: __dirname, files: __dirname,
}) })
if (skipped) return
it('should have externals for those in config.serverExternalPackages', async () => { it('should have externals for those in config.serverExternalPackages', async () => {
const $ = await next.render$('/') const $ = await next.render$('/')
......
...@@ -5,17 +5,15 @@ import { getDistDir, retry } from 'next-test-utils' ...@@ -5,17 +5,15 @@ import { getDistDir, retry } from 'next-test-utils'
const strictRouteTypes = const strictRouteTypes =
process.env.__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES === 'true' process.env.__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES === 'true'
// 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('typed-routes-validator', () => { describe('typed-routes-validator', () => {
const { next, isNextDev, isNextStart, skipped } = nextTestSetup({ const { next, isNextDev, isNextStart } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
it('should generate route validation correctly', async () => { it('should generate route validation correctly', async () => {
if (isNextDev) { if (isNextDev) {
await next.start() await next.start()
......
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.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('typed-links', () => { describe('typed-links', () => {
const { next, isNextStart, skipped } = nextTestSetup({ const { next, isNextStart } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) {
return
}
it('should generate types for next/link', async () => { it('should generate types for next/link', async () => {
await retry(async () => { await retry(async () => {
const dts = await next.readFile(`${next.distDir}/types/link.d.ts`) const dts = await next.readFile(`${next.distDir}/types/link.d.ts`)
......
...@@ -12,16 +12,14 @@ type RewriteRoutes = "/api-legacy/[version]/[[...endpoint]]" | "/docs-old/[...pa ...@@ -12,16 +12,14 @@ type RewriteRoutes = "/api-legacy/[version]/[[...endpoint]]" | "/docs-old/[...pa
type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes | AppRouteHandlerRoutes type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes | AppRouteHandlerRoutes
` `
// 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('typed-routes', () => { describe('typed-routes', () => {
const { next, isNextDev, isNextStart, skipped } = nextTestSetup({ const { next, isNextDev, isNextStart } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) {
return
}
it('should generate route types correctly', async () => { it('should generate route types correctly', async () => {
// Route type generation happens after the "Ready" log fires; give it time. // Route type generation happens after the "Ready" log fires; give it time.
await retry(async () => { await retry(async () => {
......
...@@ -11,17 +11,15 @@ const baseEnv = { ...@@ -11,17 +11,15 @@ const baseEnv = {
// cssChunking: "graph", is Turbopack-only, so we use this as to verify whether // cssChunking: "graph", is Turbopack-only, so we use this as to verify whether
// typegen is selecting the right bundler // typegen is selecting the right bundler
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely controls the local Next.js build or server lifecycle.
// @force-gate !deploy
describe('typegen bundler env', () => { describe('typegen bundler env', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
it('defaults to Turbopack, accepting Turbopack-only config', async () => { it('defaults to Turbopack, accepting Turbopack-only config', async () => {
const { code } = await runNextCommand(['typegen', next.testDir], { const { code } = await runNextCommand(['typegen', next.testDir], {
stderr: true, stderr: true,
......
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { runNextCommand } from 'next-test-utils' import { runNextCommand } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely controls the local Next.js build or server lifecycle.
// @force-gate !deploy
describe('typegen error diagnostic', () => { describe('typegen error diagnostic', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
// We drive `next typegen` manually; no server needed. // We drive `next typegen` manually; no server needed.
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
it('fails loudly with an actionable message when route types cannot be generated', async () => { it('fails loudly with an actionable message when route types cannot be generated', async () => {
// `next typegen` runs with NODE_ENV=production, which makes the fixture's // `next typegen` runs with NODE_ENV=production, which makes the fixture's
// next.config.js throw on the missing SOME_REQUIRED_TOKEN (the same shape as // next.config.js throw on the missing SOME_REQUIRED_TOKEN (the same shape as
......
...@@ -22,6 +22,7 @@ const installCheckVisible = (browser) => { ...@@ -22,6 +22,7 @@ const installCheckVisible = (browser) => {
describe('Build Activity Indicator', () => { describe('Build Activity Indicator', () => {
// Use describe.skip so that this suite does not fail with "no tests" during deploy tests. // Use describe.skip so that this suite does not fail with "no tests" during deploy tests.
// Deploy mode exclusion: This nested suite intentionally fails a local build and asserts its CLI diagnostics.
;(isNextDeploy ? describe.skip : describe)('Invalid position config', () => { ;(isNextDeploy ? describe.skip : describe)('Invalid position config', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: join(__dirname, '..'), files: join(__dirname, '..'),
......
...@@ -15,12 +15,14 @@ const reactDependencies = { ...@@ -15,12 +15,14 @@ const reactDependencies = {
'react-dom': '19.3.0-canary-fef12a01-20260413', 'react-dom': '19.3.0-canary-fef12a01-20260413',
} }
// 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('CLI Usage', () => { describe('CLI Usage', () => {
const { next, isNextStart } = nextTestSetup({ const { next, isNextStart } = nextTestSetup({
files: join(__dirname, 'basic'), files: join(__dirname, 'basic'),
skipStart: true, skipStart: true,
dependencies: reactDependencies, dependencies: reactDependencies,
skipDeployment: true,
}) })
/** /**
......
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
import { BUILD_ID_FILE, BUILD_MANIFEST } from 'next/constants' import { BUILD_ID_FILE, BUILD_MANIFEST } from 'next/constants'
// 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('distDir', () => { describe('distDir', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) return
it('should render the page', async () => { it('should render the page', async () => {
const html = await next.render('/') const html = await next.render('/')
...@@ -28,11 +29,10 @@ describe('distDir', () => { ...@@ -28,11 +29,10 @@ describe('distDir', () => {
if (isNextStart) { if (isNextStart) {
describe('distDir config validation', () => { describe('distDir config validation', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
}) })
if (skipped) return
it('should throw error with invalid distDir', async () => { it('should throw error with invalid distDir', async () => {
const origConfig = await next.readFile('next.config.js') const origConfig = await next.readFile('next.config.js')
......
...@@ -2,16 +2,17 @@ import { nextTestSetup, isNextDev } from 'e2e-utils' ...@@ -2,16 +2,17 @@ import { nextTestSetup, isNextDev } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
import cheerio from 'cheerio' import cheerio from 'cheerio'
// 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('env-config', () => { describe('env-config', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
env: { env: {
PROCESS_ENV_KEY: 'processenvironment', PROCESS_ENV_KEY: 'processenvironment',
ENV_FILE_PROCESS_ENV: 'env-cli', ENV_FILE_PROCESS_ENV: 'env-cli',
}, },
skipDeployment: true,
}) })
if (skipped) return
const getEnvFromHtml = async (path: string) => { const getEnvFromHtml = async (path: string) => {
const html = await next.render(path) const html = await next.render(path)
......
...@@ -2,13 +2,13 @@ import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' ...@@ -2,13 +2,13 @@ import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
import stripAnsi from 'next/dist/compiled/strip-ansi' import stripAnsi from 'next/dist/compiled/strip-ansi'
// 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('jsconfig paths', () => { describe('jsconfig paths', () => {
const { next, isNextDeploy, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) return
if (isNextDeploy) return
it('should alias components', async () => { it('should alias components', async () => {
const $ = await next.render$('/basic-alias') const $ = await next.render$('/basic-alias')
...@@ -96,13 +96,14 @@ describe('jsconfig paths', () => { ...@@ -96,13 +96,14 @@ describe('jsconfig paths', () => {
} }
}) })
// 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('jsconfig paths without baseurl', () => { describe('jsconfig paths without baseurl', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
let originalJsconfigContent: string let originalJsconfigContent: string
......
...@@ -4,6 +4,9 @@ import path from 'node:path' ...@@ -4,6 +4,9 @@ import path from 'node:path'
import type { ChildProcess } from 'node:child_process' import type { ChildProcess } from 'node:child_process'
import { existsSync, readFileSync } from 'node:fs' import { existsSync, readFileSync } from 'node:fs'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely inspects local build artifacts that deploy tests do not expose.
// @force-gate !deploy
describe('next analyze', () => { describe('next analyze', () => {
if (!shouldUseTurbopack()) { if (!shouldUseTurbopack()) {
// Test suites require at least one test // Test suites require at least one test
...@@ -11,18 +14,11 @@ describe('next analyze', () => { ...@@ -11,18 +14,11 @@ describe('next analyze', () => {
return return
} }
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) {
// Test suites require at least one test
it('is skipped', () => {})
return
}
it('runs successfully without errors', async () => { it('runs successfully without errors', async () => {
let serveProcess: ChildProcess | undefined let serveProcess: ChildProcess | undefined
let stdoutBuffer = '' let stdoutBuffer = ''
......
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 asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Nullish configs in next.config.js', () => { describe('Nullish configs in next.config.js', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
afterEach(async () => { afterEach(async () => {
await next.stop().catch(() => {}) await next.stop().catch(() => {})
......
...@@ -16,6 +16,8 @@ function normalizeCodeLocInfo(str) { ...@@ -16,6 +16,8 @@ function normalizeCodeLocInfo(str) {
) )
} }
// 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.each(['default', 'babelrc', 'rust'] as const)( describe.each(['default', 'babelrc', 'rust'] as const)(
'react-compiler %s', 'react-compiler %s',
(variant) => { (variant) => {
......
...@@ -18,6 +18,9 @@ function relayCompilerValidate(next: NextInstance) { ...@@ -18,6 +18,9 @@ function relayCompilerValidate(next: NextInstance) {
} }
describe('Relay Compiler Transform - Multi Project Config', () => { describe('Relay Compiler Transform - Multi Project Config', () => {
// 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('project-a', () => { describe('project-a', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
...@@ -44,8 +47,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => { ...@@ -44,8 +47,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
startCommand: isNextDev startCommand: isNextDev
? 'pnpm run dev-project-a' ? 'pnpm run dev-project-a'
: 'pnpm run start-project-a', : 'pnpm run start-project-a',
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode.
skipDeployment: true,
}) })
relayCompilerValidate(next) relayCompilerValidate(next)
...@@ -57,6 +58,9 @@ describe('Relay Compiler Transform - Multi Project Config', () => { ...@@ -57,6 +58,9 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
}) })
}) })
// 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('project-b', () => { describe('project-b', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
...@@ -78,8 +82,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => { ...@@ -78,8 +82,6 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
startCommand: isNextDev startCommand: isNextDev
? 'pnpm run dev-project-b' ? 'pnpm run dev-project-b'
: 'pnpm run start-project-b', : 'pnpm run start-project-b',
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode.
skipDeployment: true,
}) })
relayCompilerValidate(next) relayCompilerValidate(next)
......
...@@ -2,6 +2,8 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,6 +2,8 @@ import { nextTestSetup } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils' import { renderViaHTTP } from 'next-test-utils'
// Tests Babel, not needed for Turbopack // Tests Babel, not needed for Turbopack
// Deploy mode exclusion: This suite asserts warning output from the local
// Next.js CLI, which is not available from a deployed runtime.
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)( ;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
'swc warnings by default', 'swc warnings by default',
() => { () => {
......
...@@ -2,6 +2,8 @@ import path from 'path' ...@@ -2,6 +2,8 @@ import path from 'path'
import { FileRef, nextTestSetup } from 'e2e-utils' import { FileRef, nextTestSetup } from 'e2e-utils'
describe('transpile packages', () => { describe('transpile packages', () => {
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
if ((global as any).isNextDeploy) { if ((global as any).isNextDeploy) {
it('should skip for deploy mode for now', () => {}) it('should skip for deploy mode for now', () => {})
return return
......
...@@ -5,8 +5,11 @@ import stripAnsi from 'strip-ansi' ...@@ -5,8 +5,11 @@ import stripAnsi from 'strip-ansi'
const strictRouteTypes = const strictRouteTypes =
process.env.__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES === 'true' process.env.__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES === 'true'
// Deploy mode exclusion: This suite reads local build artifacts that deployments do not expose.
// This test is skipped because it relies on `next.readFile`
// @force-gate !deploy
describe('tsconfig module: preserve', () => { describe('tsconfig module: preserve', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
'tsconfig.json': JSON.stringify({ 'tsconfig.json': JSON.stringify({
compilerOptions: { module: 'preserve' }, compilerOptions: { module: 'preserve' },
...@@ -17,15 +20,11 @@ describe('tsconfig module: preserve', () => { ...@@ -17,15 +20,11 @@ describe('tsconfig module: preserve', () => {
} }
`, `,
}, },
// This test is skipped because it relies on `next.readFile`
skipDeployment: true,
dependencies: { dependencies: {
typescript: '5.4.4', typescript: '5.4.4',
}, },
}) })
if (skipped) return
it('allows you to skip moduleResolution, esModuleInterop and resolveJsonModule when using "module: preserve"', async () => { it('allows you to skip moduleResolution, esModuleInterop and resolveJsonModule when using "module: preserve"', async () => {
let output = '' let output = ''
......
import { FileRef, nextTestSetup } from 'e2e-utils' import { FileRef, nextTestSetup } from 'e2e-utils'
describe('specified tsconfig', () => { describe('specified tsconfig', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(__dirname), files: new FileRef(__dirname),
dependencies: { dependencies: {
typescript: '5.4.4', typescript: '5.4.4',
}, },
}) })
if (skipped) {
return
}
it('app router: allows a user-specific tsconfig via the next config', async () => { it('app router: allows a user-specific tsconfig via the next config', async () => {
const html = await next.render('/') const html = await next.render('/')
expect(html).toContain('bar123') expect(html).toContain('bar123')
......
...@@ -2,16 +2,16 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,16 +2,16 @@ import { nextTestSetup } from 'e2e-utils'
// Only implemented in Webpack // Only implemented in Webpack
// Fixture uses force-dynamic which doesn't work with cache components enabled // Fixture uses force-dynamic which doesn't work with cache components enabled
;(process.env.IS_TURBOPACK_TEST && !process.env.__NEXT_CACHE_COMPONENTS // Deploy mode exclusion: This suite restarts the local server to inspect
? describe // process-global module state.
: describe.skip)('turbopack-emit-collect', () => { // @force-gate !deploy
const { next, isNextDev, skipped } = nextTestSetup({ // @force-gate turbopack
// @force-gate !cacheComponents
describe('turbopack-emit-collect', () => {
const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) return
function formatId(id: string) { function formatId(id: string) {
return id.slice(id.lastIndexOf('/src/') + 5).replace(' (ecmascript)', '') return id.slice(id.lastIndexOf('/src/') + 5).replace(' (ecmascript)', '')
} }
......
...@@ -13,7 +13,7 @@ if (!(globalThis as any).isNextStart) { ...@@ -13,7 +13,7 @@ if (!(globalThis as any).isNextStart) {
it('should skip for non-next start', () => {}) it('should skip for non-next start', () => {})
} else { } else {
describe('output: standalone with twoslash', () => { describe('output: standalone with twoslash', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
twoslash: '0.3.4', twoslash: '0.3.4',
...@@ -23,10 +23,6 @@ if (!(globalThis as any).isNextStart) { ...@@ -23,10 +23,6 @@ if (!(globalThis as any).isNextStart) {
skipStart: true, skipStart: true,
}) })
if (skipped) {
return
}
let server: any let server: any
let appPort: number let appPort: number
let tmpFolder: string let tmpFolder: string
......
...@@ -4,17 +4,13 @@ import { join } from 'path' ...@@ -4,17 +4,13 @@ import { join } from 'path'
import { nextTestSetup, FileRef } from 'e2e-utils' import { nextTestSetup, FileRef } from 'e2e-utils'
describe('Custom TypeScript Config', () => { describe('Custom TypeScript Config', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(join(__dirname, '..')), files: new FileRef(join(__dirname, '..')),
dependencies: { dependencies: {
typescript: '5.4.4', typescript: '5.4.4',
}, },
}) })
if (skipped) {
return
}
it('app router: allows a user-specific tsconfig via the next config', async () => { it('app router: allows a user-specific tsconfig via the next config', async () => {
const html = await next.render('/') const html = await next.render('/')
expect(html).toContain('bar123') expect(html).toContain('bar123')
......
...@@ -4,6 +4,9 @@ import { join } from 'path' ...@@ -4,6 +4,9 @@ import { join } from 'path'
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import { readFileSync, writeFileSync } from 'fs' import { readFileSync, writeFileSync } from 'fs'
// This suite mutates the workspace config and runs custom local build/start
// commands.
// @force-gate !deploy
describe('TypeScript Features', () => { describe('TypeScript Features', () => {
describe.each([ describe.each([
{ label: '', testBaseUrl: true }, { label: '', testBaseUrl: true },
...@@ -46,8 +49,7 @@ describe('TypeScript Features', () => { ...@@ -46,8 +49,7 @@ describe('TypeScript Features', () => {
} }
}) })
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
skipDeployment: true,
dependencies: testBaseUrl dependencies: testBaseUrl
? { ? {
typescript: '5.9.3', typescript: '5.9.3',
...@@ -58,8 +60,6 @@ describe('TypeScript Features', () => { ...@@ -58,8 +60,6 @@ describe('TypeScript Features', () => {
startCommand: startCommand:
'pnpm next ' + (isNextDev ? 'dev' : 'start') + ' packages/www', 'pnpm next ' + (isNextDev ? 'dev' : 'start') + ' packages/www',
}) })
if (skipped) return
it('should alias components', async () => { it('should alias components', async () => {
const $ = await next.render$('/basic-alias') const $ = await next.render$('/basic-alias')
expect($('body').text()).toMatch(/World/) expect($('body').text()).toMatch(/World/)
......
...@@ -5,29 +5,28 @@ const expectedErr = ...@@ -5,29 +5,28 @@ const expectedErr =
/Webpack config is undefined. You may have forgot to return properly from within the "webpack" method of your next.config.js/ /Webpack config is undefined. You may have forgot to return properly from within the "webpack" method of your next.config.js/
// Webpack-specific test, not needed for Turbopack // Webpack-specific test, not needed for Turbopack
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)( // TODO(deploy-test-completion): Re-enable this suite in deploy mode.
'undefined webpack config error', // It likely asserts local CLI or runtime output that deploy tests do not expose.
() => { // @force-gate !deploy
const { next, isNextDev, isNextStart, skipped } = nextTestSetup({ // @force-gate !turbopack
files: __dirname, describe('undefined webpack config error', () => {
skipStart: true, const { next, isNextDev, isNextStart } = nextTestSetup({
skipDeployment: true, files: __dirname,
skipStart: true,
})
;(isNextStart ? describe : describe.skip)('production mode', () => {
it.skip('should show in production mode', async () => {
const { cliOutput } = await next.build()
expect(cliOutput).toMatch(expectedErr)
}) })
if (skipped) return })
;(isNextStart ? describe : describe.skip)('production mode', () => { ;(isNextDev ? it : it.skip)(
it.skip('should show in production mode', async () => { 'should show error in development mode',
const { cliOutput } = await next.build() async () => {
expect(cliOutput).toMatch(expectedErr) await next.start()
await retry(async () => {
expect(next.cliOutput).toMatch(expectedErr)
}) })
}) }
;(isNextDev ? it : it.skip)( )
'should show error in development mode', })
async () => {
await next.start()
await retry(async () => {
expect(next.cliOutput).toMatch(expectedErr)
})
}
)
}
)
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