test: enable build-error suites in deploy mode (#100482)
## Summary
Enables five suites in deploy mode whose builds are expected to fail, or
whose setup used `patchFile` or a runtime-only env.
- **`use-cache-unknown-cache-kind`,
`use-cache-without-experimental-flag`,
`proxy-and-middleware-conflict`**: outside dev the tests assert
`next.start()` rejects and read the build diagnostics from
`next.cliOutput`, with `toContain` checks in deploy mode and the
existing snapshots locally. The first two previously branched on
`isNextStart`, so in deploy mode their dev-only `createSandbox` tests
ran instead. `proxy-and-middleware-conflict` drops its blanket
`skipDeployment`.
- **`cache-components-segment-configs`**: same `next.start()` rejection
pattern. The layout-propagation test used
`next.patchFile('app/layout.tsx', …)`, which deploy mode doesn't
support. It now has its own `nextTestSetup` whose `overrideFiles` swaps
in `fixtures/layout-runtime/app/layout.tsx`. The Turbopack location
assertion moves from `./app/layout.tsx:2:24` to `:1:14` to match the
fixture file.
- **`cache-components-errors/console-patch`**: with the gate removed in
the Sept 9 retry runs, the deployment failed because
`NODE_OPTIONS='--require ./patch-console.js'` is forwarded as both a
build and a runtime env, and Vercel's own CLI process crashed with
`Cannot find module './patch-console.js'`. In deploy mode the preload is
now scoped to the build via `buildCommand`; dev and start keep `env`.
The deploy branch asserts the deployment succeeds (so the build didn't
fail on the patched `console.log`) and that the patched log line appears
in the build output. The local snapshots are unchanged.
## Verification
- Prettier and ESLint on the changed files.
- Ran all five suites locally against this branch's local packages;
every suite passed in each of:
- `next dev` and `next start`, with Turbopack and with webpack
- deploy, Turbopack + adapter (the PR deploy job's variant)
- deploy, Webpack legacy (one of the release workflow's variants)
- Not run: Turbopack legacy deploy (`NEXT_ENABLE_ADAPTER=0`); my account
lacks deploy access to the Turbopack test team's project.
<!-- NEXT_JS_LLM -->
Showing
This diff is collapsed.
Please
register
or
sign in
to comment