Unverified Commit 05c20cd1 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

test: remove unsupported deployment ID builder cases (#98668)

### What?

Removes the legacy Vercel builder rows from the immutable-assets
deployment ID determinism test. Direct `.next` output and Vercel adapter
output remain covered, including both the standard and Cache Components
fixtures.

### Why?

Current `vercel@latest` rejects `_next/static/immutable` output when the
Next.js adapter is disabled. Disabling immutable assets is not a valid
replacement for these cases: it adds the deployment ID to asset URLs,
which intentionally changes content-hashed CSS filenames between builds.

This intentionally removes the two legacy-builder deploy-mode cases
rather than skipping or weakening their determinism assertions. The
current legacy builder no longer supports the immutable-output contract
the test verifies.

### How?

The Build Output API matrix now exercises only adapter mode, and
`NEXT_ENABLE_ADAPTER=1` is applied unconditionally. The shared two-build
comparison and all assertions for the retained direct and adapter cases
are unchanged. Builder-only mode branching and timeout handling are
removed.

### Verification

- `pnpm prettier --with-node-modules --ignore-path .prettierignore
--check test/production/deterministic-build/deployment-id.test.ts`
- `pnpm eslint --config eslint.config.mjs
test/production/deterministic-build/deployment-id.test.ts`
- `pnpm test-start-turbo
test/production/deterministic-build/deployment-id.test.ts` (3 tests
passed)

<!-- NEXT_JS_LLM -->

<!-- fleet 00754f3b-4965-4d6d-bc4c-4dbab7b188e4 -->
Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent e29a96a9
...@@ -222,11 +222,9 @@ async function runTest( ...@@ -222,11 +222,9 @@ async function runTest(
}) })
describe.each([ describe.each([
{ test: 'standard', mode: 'builder' } as const, { test: 'standard' } as const,
{ test: 'standard', mode: 'adapter' } as const, { test: 'cacheComponents' } as const,
{ test: 'cacheComponents', mode: 'builder' } as const, ])('build output API - $test adapter', ({ test }) => {
{ test: 'cacheComponents', mode: 'adapter' } as const,
])('build output API - $test $mode', ({ test, mode }) => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: { files: {
// A mock file to be able to run `vercel build` without logging in // A mock file to be able to run `vercel build` without logging in
...@@ -243,43 +241,33 @@ async function runTest( ...@@ -243,43 +241,33 @@ async function runTest(
// We use NEXT_TEST_PREFER_OFFLINE, so just declaring `vercel: latest` as a dependency still // We use NEXT_TEST_PREFER_OFFLINE, so just declaring `vercel: latest` as a dependency still
// doesn't force the latest version. // doesn't force the latest version.
buildCommand: 'pnpm dlx vercel@latest build', buildCommand: 'pnpm dlx vercel@latest build',
env: env: {
mode === 'adapter' NEXT_ENABLE_ADAPTER: '1',
? { },
NEXT_ENABLE_ADAPTER: '1',
}
: undefined,
skipStart: true, skipStart: true,
disableAutoSkewProtection: true, disableAutoSkewProtection: true,
}) })
it( it('should produce identical build outputs even when changing deployment id', async () => {
'should produce identical build outputs even when changing deployment id', let { run1, run2 } = await runTest(next, readFilesBuilder)
async () => {
let { run1, run2 } = await runTest(next, readFilesBuilder)
expect(run1.size).toBeGreaterThan(0) expect(run1.size).toBeGreaterThan(0)
expect([...run1.keys()]).toEqual([...run2.keys()]) expect([...run1.keys()]).toEqual([...run2.keys()])
if (test === 'standard') { if (test === 'standard') {
expect([...run1.keys()]).toIncludeAllMembers([ expect([...run1.keys()]).toIncludeAllMembers([
'.vercel/output/functions/app-page.func/.vc-config.json', '.vercel/output/functions/app-page.func/.vc-config.json',
'.vercel/output/functions/app-page.rsc.func/.vc-config.json', '.vercel/output/functions/app-page.rsc.func/.vc-config.json',
'.vercel/output/functions/app-route.func/.vc-config.json', '.vercel/output/functions/app-route.func/.vc-config.json',
'.vercel/output/functions/app-route.rsc.func/.vc-config.json', '.vercel/output/functions/app-route.rsc.func/.vc-config.json',
'.vercel/output/functions/pages-dynamic.func/.vc-config.json', '.vercel/output/functions/pages-dynamic.func/.vc-config.json',
'.vercel/output/functions/pages-static-gsp.func/.vc-config.json', '.vercel/output/functions/pages-static-gsp.func/.vc-config.json',
]) ])
expect([...run1.keys()]).toSatisfyAny((k) => expect([...run1.keys()]).toSatisfyAny((k) =>
k.includes('middleware.func') k.includes('middleware.func')
) )
} }
}, })
// The builder mode can take a bit longer, so we increase the timeout
// for these tests. The adapter mode should be faster, so we leave it as
// the default.
mode === 'builder' ? 120_000 : undefined
)
}) })
} }
) )
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