Unverified Commit 8af1fab7 authored by Josh Story's avatar Josh Story Committed by GitHub

test: migrate asset deploy exclusions to force gates (#98158)

## Summary

Migrate the remaining image, font, CSS, and other asset integration
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.

Shared image-optimizer exclusions are placed on the calling test suites
because gate pragmas are transformed only in test files. Existing
bundler guards in the shared helper are preserved.

## Verification

- Compared test registration against canary in development, production,
and deploy modes with test bodies and hooks disabled. Existing active
deployment assertions are preserved; development/production test
selection is unchanged apart from replacing empty skip placeholders with
skipped real tests. Checked both Webpack and Turbopack.
- 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 3ca20b5a
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils' import { check } from 'next-test-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('app dir - css', () => { describe('app dir - css', () => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
dependencies: { dependencies: {
'@picocss/pico': '1.5.7', '@picocss/pico': '1.5.7',
sass: 'latest', sass: 'latest',
...@@ -12,10 +14,6 @@ describe('app dir - css', () => { ...@@ -12,10 +14,6 @@ describe('app dir - css', () => {
}, },
}) })
if (skipped) {
return
}
describe('css support', () => { describe('css support', () => {
describe('server layouts', () => { describe('server layouts', () => {
it.skip('should support global css inside server layouts', async () => { it.skip('should support global css inside server layouts', async () => {
......
...@@ -474,7 +474,6 @@ const options = (value: CssChunkingValue) => ({ ...@@ -474,7 +474,6 @@ const options = (value: CssChunkingValue) => ({
dependencies: { dependencies: {
sass: 'latest', sass: 'latest',
}, },
skipDeployment: true,
}) })
/** /**
...@@ -514,11 +513,13 @@ function shouldSkipConflict(ordering: readonly string[]): boolean { ...@@ -514,11 +513,13 @@ function shouldSkipConflict(ordering: readonly string[]): boolean {
) )
} }
// TODO(deploy-test-completion): No deploy-specific incompatibility is
// documented.
// @force-gate !deploy
describe.each(process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_TRUE)( describe.each(process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_TRUE)(
'css-order %s', 'css-order %s',
(_label: string, value: CssChunkingValue) => { (_label: string, value: CssChunkingValue) => {
const { next, isNextDev, skipped } = nextTestSetup(options(value)) const { next, isNextDev } = nextTestSetup(options(value))
if (skipped) return
for (const ordering of allPairs) { for (const ordering of allPairs) {
const name = `should load correct styles navigating back again ${ordering.join( const name = `should load correct styles navigating back again ${ordering.join(
' -> ' ' -> '
...@@ -568,6 +569,9 @@ describe.each(process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_TRUE)( ...@@ -568,6 +569,9 @@ describe.each(process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_TRUE)(
} }
} }
) )
// TODO(deploy-test-completion): No deploy-specific incompatibility is
// documented.
// @force-gate !deploy
describe.each( describe.each(
process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_LOOSE process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_LOOSE
)('css-order %s', (_label: string, value: CssChunkingValue) => { )('css-order %s', (_label: string, value: CssChunkingValue) => {
...@@ -611,6 +615,9 @@ describe.each( ...@@ -611,6 +615,9 @@ describe.each(
}) })
} }
}) })
// TODO(deploy-test-completion): No deploy-specific incompatibility is
// documented.
// @force-gate !deploy
describe.each( describe.each(
process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_LOOSE process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_LOOSE
)('css-order %s', (_label: string, value: CssChunkingValue) => { )('css-order %s', (_label: string, value: CssChunkingValue) => {
...@@ -650,6 +657,8 @@ describe.each( ...@@ -650,6 +657,8 @@ describe.each(
// Webpack currently applies the client child's CSS module after the parent module in // Webpack currently applies the client child's CSS module after the parent module in
// App Router server-component-with-client-child cases. Gate only those known divergences; // App Router server-component-with-client-child cases. Gate only those known divergences;
// the other package sideEffects scenarios share expectations across both bundlers. // the other package sideEffects scenarios share expectations across both bundlers.
// The fixture creates dummy packages locally; they are unavailable to deployment builds.
// @force-gate !deploy
describe.each( describe.each(
process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_LOOSE process.env.IS_TURBOPACK_TEST ? TURBO_MODES : WEBPACK_MODES_LOOSE
)('css-order sideEffects %s', (_label: string, value: CssChunkingValue) => { )('css-order sideEffects %s', (_label: string, value: CssChunkingValue) => {
......
...@@ -3,16 +3,14 @@ import { listClientChunks } from 'next-test-utils' ...@@ -3,16 +3,14 @@ import { listClientChunks } from 'next-test-utils'
import fs from 'node:fs/promises' import fs from 'node:fs/promises'
import path from 'node:path' import path from 'node:path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely reads files from the isolated local fixture.
// @force-gate !deploy
describe('css-server-chunks', () => { describe('css-server-chunks', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) {
return
}
it('should not write CSS chunks for the server', async () => { it('should not write CSS chunks for the server', async () => {
// Fetch all routes to compile them in development // Fetch all routes to compile them in development
expect((await next.fetch('/client')).status).toBe(200) expect((await next.fetch('/client')).status).toBe(200)
......
...@@ -18,12 +18,11 @@ const getAttrs = (elems: Cheerio) => ...@@ -18,12 +18,11 @@ const getAttrs = (elems: Cheerio) =>
.sort((a, b) => (a.href < b.href ? -1 : 1)) .sort((a, b) => (a.href < b.href ? -1 : 1))
describe('app dir - next/font', () => { describe('app dir - next/font', () => {
// 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('app dir - next-font', () => { describe('app dir - next-font', () => {
const { const { next, isNextDev: isDev } = nextTestSetup({
next,
isNextDev: isDev,
skipped,
} = nextTestSetup({
files: { files: {
app: new FileRef(join(__dirname, 'app')), app: new FileRef(join(__dirname, 'app')),
fonts: new FileRef(join(__dirname, 'fonts')), fonts: new FileRef(join(__dirname, 'fonts')),
...@@ -33,13 +32,8 @@ describe('app dir - next/font', () => { ...@@ -33,13 +32,8 @@ describe('app dir - next/font', () => {
dependencies: { dependencies: {
'@next/font': 'workspace:*', '@next/font': 'workspace:*',
}, },
skipDeployment: true,
}) })
if (skipped) {
return
}
describe('import values', () => { describe('import values', () => {
it('should have correct values at /', async () => { it('should have correct values at /', async () => {
const $ = await next.render$('/') const $ = await next.render$('/')
......
...@@ -8,15 +8,14 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -8,15 +8,14 @@ import { nextTestSetup } from 'e2e-utils'
let proxyPort let proxyPort
let proxyServer: https.Server let proxyServer: https.Server
// Deploy mode exclusion: This suite controls a local server or proxy process.
// This test is skipped when deployed because it relies on a proxy server
// @force-gate !deploy
describe('next-image-proxy', () => { describe('next-image-proxy', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// This test is skipped when deployed because it relies on a proxy server
skipDeployment: true,
}) })
if (skipped) return
beforeAll(async () => { beforeAll(async () => {
proxyPort = await findPort() proxyPort = await findPort()
......
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 asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('no-double-tailwind-execution', () => { describe('no-double-tailwind-execution', () => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next, isNextDev } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
dependencies: { dependencies: {
'@tailwindcss/postcss': '^4', '@tailwindcss/postcss': '^4',
tailwindcss: '^4', tailwindcss: '^4',
...@@ -15,10 +17,6 @@ describe('no-double-tailwind-execution', () => { ...@@ -15,10 +17,6 @@ describe('no-double-tailwind-execution', () => {
}, },
}) })
if (skipped) {
return
}
it('should run tailwind only once initially and per change', async () => { it('should run tailwind only once initially and per change', async () => {
const browser = await next.browser('/') const browser = await next.browser('/')
expect(await browser.elementByCss('p').text()).toBe('hello world') expect(await browser.elementByCss('p').text()).toBe('hello world')
......
...@@ -6,6 +6,8 @@ const nextConfig = { ...@@ -6,6 +6,8 @@ const nextConfig = {
productionBrowserSourceMaps: true, productionBrowserSourceMaps: true,
} }
// This suite reads emitted CSS and source maps from the local build output.
// @force-gate !deploy
describe.each([ describe.each([
{ dependencies: { sass: '1.54.0' }, nextConfig }, { dependencies: { sass: '1.54.0' }, nextConfig },
{ {
...@@ -18,17 +20,15 @@ describe.each([ ...@@ -18,17 +20,15 @@ describe.each([
}, },
}, },
])('SCSS Support ($dependencies)', ({ dependencies, nextConfig }) => { ])('SCSS Support ($dependencies)', ({ dependencies, nextConfig }) => {
const { next, isNextDev, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
// This test is skipped because it is reading files in the `.next` file which
// isn't available/necessary in a deployment environment.
skipDeployment: true,
dependencies, dependencies,
nextConfig, nextConfig,
}) })
if (skipped) return // TODO: Figure out this test for dev and Turbopack // This section only asserts production build output.
;(isNextDev ? describe.skip : describe)('Production only', () => { // @force-gate !dev
describe('Production only', () => {
describe('CSS Compilation and Prefixing', () => { describe('CSS Compilation and Prefixing', () => {
it(`should've compiled and prefixed`, async () => { it(`should've compiled and prefixed`, async () => {
const $ = await next.render$('/') const $ = await next.render$('/')
......
...@@ -5,16 +5,16 @@ import cheerio from 'cheerio' ...@@ -5,16 +5,16 @@ import cheerio from 'cheerio'
import { findPort } from 'next-test-utils' import { findPort } from 'next-test-utils'
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
// Deploy mode exclusion: This suite controls a local server or proxy process.
// Calls `next.build()` and uses an in-test proxy in front of the Next
// server; both rely on the local-process model and are not applicable to
// deploy mode.
// @force-gate !deploy
describe('CSS Module client-side navigation', () => { describe('CSS Module client-side navigation', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
// Calls `next.build()` and uses an in-test proxy in front of the Next
// server; both rely on the local-process model and are not applicable to
// deploy mode.
skipDeployment: true,
}) })
if (skipped) return
let proxyServer: http.Server let proxyServer: http.Server
let proxyPort: number let proxyPort: number
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with contentDispositionType inline', () => { describe('with contentDispositionType inline', () => {
setupTests({ setupTests({
nextConfigImages: { contentDispositionType: 'inline' }, nextConfigImages: { contentDispositionType: 'inline' },
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with dangerouslyAllowSVG config', () => { describe('with dangerouslyAllowSVG config', () => {
setupTests({ setupTests({
nextConfigImages: { dangerouslyAllowSVG: true }, nextConfigImages: { dangerouslyAllowSVG: true },
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with isrFlushToDisk false config', () => { describe('with isrFlushToDisk false config', () => {
setupTests({ setupTests({
nextConfigExperimental: { isrFlushToDisk: false }, nextConfigExperimental: { isrFlushToDisk: false },
......
...@@ -13,14 +13,15 @@ function toQueryString(query: Record<string, any>): string { ...@@ -13,14 +13,15 @@ function toQueryString(query: Record<string, any>): string {
const largeSize = 1080 const largeSize = 1080
// Preserve the file-wide deploy exclusion previously imposed by skipDeployment's it.only.
// @force-gate !deploy
describe('Image Optimizer', () => { describe('Image Optimizer', () => {
// These checks inspect local build errors and cannot run against a deployment.
describe('config checks', () => { describe('config checks', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: join(__dirname, 'app'), files: join(__dirname, 'app'),
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
const configChecks: Array<{ const configChecks: Array<{
name: string name: string
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with maximumDiskCacheSize 85KB config', () => { describe('with maximumDiskCacheSize 85KB config', () => {
setupTests({ setupTests({
nextConfigImages: { nextConfigImages: {
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with maximumDiskCacheSize zero config', () => { describe('with maximumDiskCacheSize zero config', () => {
setupTests({ setupTests({
nextConfigImages: { nextConfigImages: {
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with maximumRedirects 0', () => { describe('with maximumRedirects 0', () => {
setupTests({ setupTests({
nextConfigImages: { nextConfigImages: {
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with maximumRedirects 1', () => { describe('with maximumRedirects 1', () => {
setupTests({ setupTests({
nextConfigImages: { nextConfigImages: {
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with minimumCacheTTL of 5 sec', () => { describe('with minimumCacheTTL of 5 sec', () => {
setupTests({ setupTests({
nextConfigImages: { nextConfigImages: {
......
import { setupTests } from './util' import { setupTests } from './util'
// Deployments use the Vercel image CDN instead of the local image pipeline.
// @force-gate !deploy
describe('with latest sharp', () => { describe('with latest sharp', () => {
setupTests({}) setupTests({})
}) })
...@@ -1764,19 +1764,12 @@ export const setupTests = (ctx: SetupTestsCtx) => { ...@@ -1764,19 +1764,12 @@ export const setupTests = (ctx: SetupTestsCtx) => {
if (!ctx.nextConfigImages) { if (!ctx.nextConfigImages) {
maybeSkipTurbopackProd('w/o next.config.js', () => { maybeSkipTurbopackProd('w/o next.config.js', () => {
const size = 384 const size = 384
const { next, isNextDeploy } = nextTestSetup({ const { next } = nextTestSetup({
files: join(__dirname, 'app'), files: join(__dirname, 'app'),
nextConfig: ctx.nextConfigExperimental nextConfig: ctx.nextConfigExperimental
? { experimental: ctx.nextConfigExperimental } ? { experimental: ctx.nextConfigExperimental }
: undefined, : undefined,
// The image optimizer suite asserts on the local Next.js image
// pipeline (custom upstream HTTP server, on-disk cache, response
// headers from `/_next/image`). Vercel's deploy serves images
// through its own image CDN with different headers, paths, and
// cache semantics, so these assertions don't apply.
skipDeployment: true,
}) })
if (isNextDeploy) return
runTests({ runTests({
next, next,
...@@ -1805,7 +1798,7 @@ export const setupTests = (ctx: SetupTestsCtx) => { ...@@ -1805,7 +1798,7 @@ export const setupTests = (ctx: SetupTestsCtx) => {
...ctx.nextConfigImages, ...ctx.nextConfigImages,
} }
const { next, isNextDeploy } = nextTestSetup({ const { next } = nextTestSetup({
files: join(__dirname, 'app'), files: join(__dirname, 'app'),
nextConfig: { nextConfig: {
images: mergedImages, images: mergedImages,
...@@ -1813,14 +1806,7 @@ export const setupTests = (ctx: SetupTestsCtx) => { ...@@ -1813,14 +1806,7 @@ export const setupTests = (ctx: SetupTestsCtx) => {
? { experimental: ctx.nextConfigExperimental } ? { experimental: ctx.nextConfigExperimental }
: {}), : {}),
}, },
// The image optimizer suite asserts on the local Next.js image
// pipeline (custom upstream HTTP server, on-disk cache, response
// headers from `/_next/image`). Vercel's deploy serves images
// through its own image CDN with different headers, paths, and
// cache semantics, so these assertions don't apply.
skipDeployment: true,
}) })
if (isNextDeploy) return
runTests({ runTests({
next, next,
......
...@@ -3,16 +3,17 @@ import type { Server } from 'http' ...@@ -3,16 +3,17 @@ import type { Server } from 'http'
import { findPort } from 'next-test-utils' import { findPort } 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('next/dynamic with assetPrefix', () => { describe('next/dynamic with assetPrefix', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
dependencies: { dependencies: {
sass: '1.54.0', sass: '1.54.0',
}, },
skipDeployment: true,
}) })
if (skipped) return
let cdnPort: number let cdnPort: number
let cdn: Server let cdn: Server
......
...@@ -7,12 +7,9 @@ const mockedGoogleFontResponses = require.resolve( ...@@ -7,12 +7,9 @@ const mockedGoogleFontResponses = require.resolve(
'./google-font-mocked-responses.js' './google-font-mocked-responses.js'
) )
// Deploy mode exclusion: This suite passes an absolute local mocked-font-response path into the build.
// @force-gate !deploy
describe('next/font/google basepath', () => { describe('next/font/google basepath', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
pages: new FileRef(join(__dirname, 'basepath/pages')), pages: new FileRef(join(__dirname, 'basepath/pages')),
......
...@@ -5,15 +5,12 @@ const mockedGoogleFontResponses = require.resolve( ...@@ -5,15 +5,12 @@ const mockedGoogleFontResponses = require.resolve(
'./google-font-mocked-responses.js' './google-font-mocked-responses.js'
) )
// Deploy mode exclusion: This suite intentionally fails the build, so there is no successful deployment to exercise.
// @force-gate !deploy
describe('next/font/google fetch error', () => { describe('next/font/google fetch error', () => {
const isDev = (global as any).isNextDev const isDev = (global as any).isNextDev
const isTurbopack = !!process.env.IS_TURBOPACK_TEST const isTurbopack = !!process.env.IS_TURBOPACK_TEST
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
pages: new FileRef(join(__dirname, 'google-fetch-error/pages')), pages: new FileRef(join(__dirname, 'google-fetch-error/pages')),
......
...@@ -35,12 +35,9 @@ function hrefMatchesFontWithoutSizeAdjust(href: string) { ...@@ -35,12 +35,9 @@ function hrefMatchesFontWithoutSizeAdjust(href: string) {
} }
} }
// Deploy mode exclusion: This suite passes an absolute local mocked-font-response path into the build.
// @force-gate !deploy
describe('next/font', () => { describe('next/font', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
pages: new FileRef(join(__dirname, `app/pages`)), pages: new FileRef(join(__dirname, `app/pages`)),
......
...@@ -9,12 +9,9 @@ const mockedGoogleFontResponses = require.resolve( ...@@ -9,12 +9,9 @@ const mockedGoogleFontResponses = require.resolve(
const isDev = (global as any).isNextDev const isDev = (global as any).isNextDev
// Deploy mode exclusion: This suite passes an absolute local mocked-font-response path into the build.
// @force-gate !deploy
describe('next/font/google with-font-declarations-file', () => { describe('next/font/google with-font-declarations-file', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: join(__dirname, 'with-font-declarations-file'), files: join(__dirname, 'with-font-declarations-file'),
env: { env: {
......
...@@ -3,12 +3,9 @@ import { findPort, renderViaHTTP, fetchViaHTTP } from 'next-test-utils' ...@@ -3,12 +3,9 @@ import { findPort, renderViaHTTP, fetchViaHTTP } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
import spawn from 'cross-spawn' import spawn from 'cross-spawn'
// Deploy mode exclusion: This suite spawns a local proxy process.
// @force-gate !deploy
describe('next/font/google with proxy', () => { describe('next/font/google with proxy', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(join(__dirname, 'with-proxy')), files: new FileRef(join(__dirname, 'with-proxy')),
skipStart: true, skipStart: true,
......
...@@ -7,12 +7,9 @@ const mockedGoogleFontResponses = require.resolve( ...@@ -7,12 +7,9 @@ const mockedGoogleFontResponses = require.resolve(
'./google-font-mocked-responses.js' './google-font-mocked-responses.js'
) )
// Deploy mode exclusion: This suite passes an absolute local mocked-font-response path into the build.
// @force-gate !deploy
describe('next/font/google without-preloaded-fonts without _app', () => { describe('next/font/google without-preloaded-fonts without _app', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
'pages/no-preload.js': new FileRef( 'pages/no-preload.js': new FileRef(
...@@ -53,12 +50,9 @@ describe('next/font/google without-preloaded-fonts without _app', () => { ...@@ -53,12 +50,9 @@ describe('next/font/google without-preloaded-fonts without _app', () => {
}) })
}) })
// Deploy mode exclusion: This suite passes an absolute local mocked-font-response path into the build.
// @force-gate !deploy
describe('next/font/google no preloads with _app', () => { describe('next/font/google no preloads with _app', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
'pages/_app.js': new FileRef( 'pages/_app.js': new FileRef(
......
...@@ -2,6 +2,8 @@ import { FileRef, nextTestSetup } from 'e2e-utils' ...@@ -2,6 +2,8 @@ import { FileRef, nextTestSetup } from 'e2e-utils'
import { waitFor } from 'next-test-utils' import { waitFor } from 'next-test-utils'
import path from 'path' import path from 'path'
// 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-image-forward-ref', () => { describe('next-image-forward-ref', () => {
const appDir = path.join(__dirname, 'app') const appDir = path.join(__dirname, 'app')
......
import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils' import { nextTestSetup, isNextDev, type Playwright } from 'e2e-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('Build Error Tests for basePath', () => { describe('Build Error Tests for basePath', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (isNextDev) { if (isNextDev) {
...@@ -31,12 +33,13 @@ describe('Build Error Tests for basePath', () => { ...@@ -31,12 +33,13 @@ describe('Build Error Tests for basePath', () => {
}) })
}) })
// 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('Static Image Component Tests for basePath', () => { describe('Static Image Component Tests for basePath', () => {
const { next, isTurbopack, skipped } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) return
let browser: Playwright let browser: Playwright
let html: string let html: string
......
...@@ -7,20 +7,20 @@ import { ...@@ -7,20 +7,20 @@ import {
retry, retry,
} from 'next-test-utils' } from 'next-test-utils'
// Deploy mode exclusion: This suite reads local build artifacts that deployments do not expose.
// Image URL assertions construct expected URLs via
// `getDeploymentId(next.testDir, ...)`, which reads the local
// `.next/required-server-files.json`. In deploy mode that file lives on
// Vercel's infrastructure (not on disk locally), so the constructed
// expected URL omits the `&dpl=...` query that Vercel injects at
// runtime. The assertions are about local-build URL shape, not deploy
// CDN URLs, so skip in deploy.
// @force-gate !deploy
describe('Legacy Image Component basePath Tests', () => { describe('Legacy Image Component basePath Tests', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
// Image URL assertions construct expected URLs via
// `getDeploymentId(next.testDir, ...)`, which reads the local
// `.next/required-server-files.json`. In deploy mode that file lives on
// Vercel's infrastructure (not on disk locally), so the constructed
// expected URL omits the `&dpl=...` query that Vercel injects at
// runtime. The assertions are about local-build URL shape, not deploy
// CDN URLs, so skip in deploy.
skipDeployment: true,
}) })
if (skipped) return
let dpl: string let dpl: string
beforeAll(() => { beforeAll(() => {
......
...@@ -7,13 +7,14 @@ import { ...@@ -7,13 +7,14 @@ import {
} from 'e2e-utils' } from 'e2e-utils'
import cheerio from 'cheerio' import cheerio from 'cheerio'
// 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('Build Error Tests', () => { describe('Build Error Tests', () => {
const { next, isTurbopack, isRspack, isNextDeploy } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (isNextDeploy) return
;(isNextStart ? it : it.skip)( ;(isNextStart ? it : it.skip)(
'should throw build error when import statement is used with missing file', 'should throw build error when import statement is used with missing file',
async () => { async () => {
...@@ -43,6 +44,8 @@ describe('Build Error Tests', () => { ...@@ -43,6 +44,8 @@ describe('Build Error Tests', () => {
) )
}) })
// Preserve the sibling suite's deploy exclusion previously imposed by skipDeployment's it.only.
// @force-gate !deploy
describe('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
......
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
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 expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('TypeScript Image Component', () => { describe('TypeScript Image Component', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (skipped) return
if (isNextStart) { // @force-gate start
describe('production', () => {
it('should fail to build invalid usage of the Image component', async () => { it('should fail to build invalid usage of the Image component', async () => {
const { cliOutput, exitCode } = await next.build() const { cliOutput, exitCode } = await next.build()
expect(cliOutput).toMatch(/Failed to type check/) expect(cliOutput).toMatch(/Failed to type check/)
...@@ -41,9 +43,10 @@ describe('TypeScript Image Component', () => { ...@@ -41,9 +43,10 @@ describe('TypeScript Image Component', () => {
) )
expect(envTypes).not.toContain('image-types/global') expect(envTypes).not.toContain('image-types/global')
}) })
} })
if (isNextDev) { // @force-gate dev
describe('development', () => {
let output = '' let output = ''
beforeAll(async () => { beforeAll(async () => {
...@@ -95,5 +98,5 @@ describe('TypeScript Image Component', () => { ...@@ -95,5 +98,5 @@ describe('TypeScript Image Component', () => {
) )
expect(envTypes).not.toContain('image-types/global') expect(envTypes).not.toContain('image-types/global')
}) })
} })
}) })
...@@ -5,10 +5,12 @@ import { ...@@ -5,10 +5,12 @@ import {
waitForRedbox, waitForRedbox,
} from 'next-test-utils' } from 'next-test-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('Image localPatterns config', () => { describe('Image localPatterns config', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
async function getSrc(browser: Playwright, id: string) { async function getSrc(browser: Playwright, id: string) {
......
import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils' import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils'
import { waitForNoRedbox } from 'next-test-utils' import { waitForNoRedbox } from 'next-test-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('Image qualities config', () => { describe('Image qualities config', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
async function getSrc(browser: Playwright, id: string) { async function getSrc(browser: Playwright, id: string) {
......
...@@ -11,13 +11,14 @@ import { nextTestSetup, isNextDev } from 'e2e-utils' ...@@ -11,13 +11,14 @@ import { nextTestSetup, isNextDev } from 'e2e-utils'
import { existsSync } from 'fs' import { existsSync } from 'fs'
import { join } from 'path' import { join } from 'path'
// 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('Image Component App Dir Tests', () => { describe('Image Component App Dir Tests', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
if (skipped) return
let dpl: string let dpl: string
let assetDpl: string let assetDpl: string
......
import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils' import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils'
import cheerio from 'cheerio' import cheerio from 'cheerio'
// 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('Build Error Tests', () => { describe('Build Error Tests', () => {
const { next, isTurbopack, isRspack, isNextDeploy } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
if (isNextDeploy) return
if (isNextDev) { if (isNextDev) {
it('no-op in dev', () => {}) it('no-op in dev', () => {})
...@@ -40,12 +41,13 @@ describe('Build Error Tests', () => { ...@@ -40,12 +41,13 @@ describe('Build Error Tests', () => {
}) })
}) })
// 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('Static Image Component Tests for basePath', () => { describe('Static Image Component Tests for basePath', () => {
const { next, isTurbopack, skipped } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
if (skipped) return
let browser: Playwright let browser: Playwright
let $: ReturnType<typeof cheerio.load> let $: ReturnType<typeof cheerio.load>
......
...@@ -7,20 +7,20 @@ import { ...@@ -7,20 +7,20 @@ import {
retry, retry,
} from 'next-test-utils' } from 'next-test-utils'
// Deploy mode exclusion: This suite reads local build artifacts that deployments do not expose.
// Image URL assertions construct expected URLs via
// `getDeploymentId(next.testDir, ...)`, which reads the local
// `.next/required-server-files.json`. In deploy mode that file lives on
// Vercel's infrastructure (not on disk locally), so the constructed
// expected URL omits the `&dpl=...` query that Vercel injects at
// runtime. The assertions are about local-build URL shape, not deploy
// CDN URLs, so skip in deploy.
// @force-gate !deploy
describe('Image Component basePath Tests', () => { describe('Image Component basePath Tests', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
// Image URL assertions construct expected URLs via
// `getDeploymentId(next.testDir, ...)`, which reads the local
// `.next/required-server-files.json`. In deploy mode that file lives on
// Vercel's infrastructure (not on disk locally), so the constructed
// expected URL omits the `&dpl=...` query that Vercel injects at
// runtime. The assertions are about local-build URL shape, not deploy
// CDN URLs, so skip in deploy.
skipDeployment: true,
}) })
if (skipped) return
let dpl: string let dpl: string
beforeAll(() => { beforeAll(() => {
......
import { nextTestSetup, isNextDev } from 'e2e-utils' import { nextTestSetup, isNextDev } from 'e2e-utils'
import { getDeploymentId } from 'next-test-utils' import { getDeploymentId } from 'next-test-utils'
// Deploy mode exclusion: This suite reads local build artifacts that deployments do not expose.
// Image URL assertions construct expected URLs via
// `getDeploymentId(next.testDir, ...)`, which reads the local
// `.next/required-server-files.json`. In deploy mode that file lives on
// Vercel's infrastructure (not on disk locally), so the constructed
// expected URL omits the `&dpl=...` query that Vercel injects at
// runtime. The assertions are about local-build URL shape, not deploy
// CDN URLs, so skip in deploy.
// @force-gate !deploy
describe('Image Component basePath + trailingSlash Tests', () => { describe('Image Component basePath + trailingSlash Tests', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
// Image URL assertions construct expected URLs via
// `getDeploymentId(next.testDir, ...)`, which reads the local
// `.next/required-server-files.json`. In deploy mode that file lives on
// Vercel's infrastructure (not on disk locally), so the constructed
// expected URL omits the `&dpl=...` query that Vercel injects at
// runtime. The assertions are about local-build URL shape, not deploy
// CDN URLs, so skip in deploy.
skipDeployment: true,
}) })
if (skipped) return
let dpl: string let dpl: string
let assetDpl: string let assetDpl: string
......
import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils' import { nextTestSetup, isNextDev, type Playwright } from 'e2e-utils'
import cheerio from 'cheerio' import cheerio from 'cheerio'
// 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('Build Error Tests', () => { describe('Build Error Tests', () => {
const { next, isNextDeploy, isRspack } = nextTestSetup({ const { next, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
if (isNextDeploy) return
if (isNextDev) { if (isNextDev) {
it('no-op in dev', () => {}) it('no-op in dev', () => {})
...@@ -37,13 +38,14 @@ describe('Build Error Tests', () => { ...@@ -37,13 +38,14 @@ describe('Build Error Tests', () => {
}) })
}) })
// 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('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
const { next, isTurbopack, skipped } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
if (skipped) return
let browser: Playwright let browser: Playwright
let $: ReturnType<typeof cheerio.load> let $: ReturnType<typeof cheerio.load>
......
...@@ -12,16 +12,16 @@ import { isReact18, nextTestSetup, isNextDev } from 'e2e-utils' ...@@ -12,16 +12,16 @@ import { isReact18, nextTestSetup, isNextDev } from 'e2e-utils'
import { existsSync } from 'fs' import { existsSync } from 'fs'
import { join } from 'path' import { join } from 'path'
// Deploy mode exclusion: This suite reads local build artifacts that deployments do not expose.
// Image URL assertions assume local-relative `/_next/image?url=...`
// paths and access to `.next/static` on disk; deploy mode rewrites URLs
// through the Vercel hostname and has no on-disk `.next/`.
// @force-gate !deploy
describe('Image Component Default Tests', () => { describe('Image Component Default Tests', () => {
const { next, skipped } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
// Image URL assertions assume local-relative `/_next/image?url=...`
// paths and access to `.next/static` on disk; deploy mode rewrites URLs
// through the Vercel hostname and has no on-disk `.next/`.
skipDeployment: true,
}) })
if (skipped) return
let dpl: string let dpl: string
let assetDpl: string let assetDpl: string
......
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.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('TypeScript Image Component Build Errors', () => { describe('TypeScript Image Component Build Errors', () => {
if (isNextDev) { if (isNextDev) {
it('no-op in dev', () => {}) it('no-op in dev', () => {})
...@@ -10,7 +13,6 @@ describe('TypeScript Image Component Build Errors', () => { ...@@ -10,7 +13,6 @@ describe('TypeScript Image Component Build Errors', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipStart: true, skipStart: true,
skipDeployment: true,
}) })
it('should fail to build invalid usage of the Image component', async () => { it('should fail to build invalid usage of the Image component', async () => {
......
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 inspects local build artifacts that deploy tests do not expose.
// @force-gate !deploy
describe('Image Component Unicode Image URL', () => { describe('Image Component Unicode Image URL', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
it('should load static unicode image', async () => { it('should load static unicode image', async () => {
......
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.
// It likely inspects local build artifacts that deploy tests do not expose.
// @force-gate !deploy
describe('Unoptimized Image Tests', () => { describe('Unoptimized Image Tests', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
skipDeployment: true,
}) })
function runTests(url: string) { function runTests(url: string) {
......
import { FileRef, nextTestSetup } from 'e2e-utils' import { FileRef, nextTestSetup } from 'e2e-utils'
import { join } from 'path' import { join } from 'path'
// 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('postcss-config-cjs', () => { describe('postcss-config-cjs', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(join(__dirname, 'app')), files: new FileRef(join(__dirname, 'app')),
......
import { isNextDeploy, nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils' import { retry } from 'next-test-utils'
// `experimental.turbopackWorkerAssetPrefix` is turbopack-only.
const isTurbopack = !process.env.IS_WEBPACK_TEST && !process.env.NEXT_RSPACK
const describeTurbopack =
isTurbopack && !isNextDeploy ? describe : describe.skip
// CORS so cross-origin script tags from `assetPrefix` can be fetched. Workers // CORS so cross-origin script tags from `assetPrefix` can be fetched. Workers
// are NOT covered by CORS — `new Worker(crossOriginUrl)` is rejected // are NOT covered by CORS — `new Worker(crossOriginUrl)` is rejected
// regardless — so this only unblocks regular script loading. // regardless — so this only unblocks regular script loading.
...@@ -29,7 +24,10 @@ const corsHeadersConfig = ` ...@@ -29,7 +24,10 @@ const corsHeadersConfig = `
* runtime helper resolved from `turbopackWorkerAssetPrefix`, so each test * runtime helper resolved from `turbopackWorkerAssetPrefix`, so each test
* can assert on that URL directly. * can assert on that URL directly.
*/ */
describeTurbopack('turbopack-worker-asset-prefix', () => { // `experimental.turbopackWorkerAssetPrefix` is turbopack-only.
// Deploy mode exclusion: This suite models cross-origin loading with `localhost` and `127.0.0.1` on a local port.
// @force-gate turbopack && !deploy
describe('turbopack-worker-asset-prefix', () => {
describe('without turbopackWorkerAssetPrefix (cross-origin assetPrefix)', () => { describe('without turbopackWorkerAssetPrefix (cross-origin assetPrefix)', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
......
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