Unverified Commit dc671ee5 authored by Jamiboy Mohammad's avatar Jamiboy Mohammad Committed by GitHub

test: enable Nx deployment coverage (#99407)

## Summary

Enable all four `nx-handling` assertions in deployment mode with
Corepack and the fixture's Nx output directory,
`dist/apps/next-nx-test/.next`.

Limit Nx's Next plugin to app configs so the test harness's generated
root `next.config.js` is not inferred as an unnamed project. Copy the
nested app config through `patchFileWithDeployEnvAssignments()` so
deploy mode appends the same captured experimental flags as the root
harness, including partial prefetching. Other modes copy the config
unchanged; the fixture no longer contains deployment aliases. Dependency
versions, build/start commands, and all four assertions are unchanged.

This is the fourth layer of stack #99535, based on #99395 (which depends
on #99534 and #99533). Remove the migrated `@force-gate !deploy`
exclusion to preserve this PR's deployment coverage.

## Verification

- Before the shared-helper refactor, real Vercel deployments using the
original failing preview package
(`ee2c9472836846212e8b65127a9bd35da2a02b25`): all four assertions passed
in both
[normal](https://vercel.com/vtest314-next-adapter-e2e-tests/vtest314-e2e-tests/2Y9Ka9dPdvTKw4D8tsGSQ6s1TfJp)
and
[cache-components](https://vercel.com/vtest314-next-adapter-e2e-tests/vtest314-e2e-tests/D2rBBSd1m6sxjG5oMHHNGXcukBja)
modes. The latter build explicitly reports Cache Components and cached
navigations enabled.
- After the rebase and helper refactor, local production Turbopack
build/start against the bootstrapped source package
(`16.4.0-canary.55`): all four assertions passed.
- Full bootstrap (18/18 tasks), repository TypeScript, formatting,
ESLint, and 41 existing deployment helper/lifecycle unit tests passed.
- After the shared-helper refactor (`5f9881c566`), targeted real Vercel
deployments against `16.4.0-canary.55`: all four assertions executed and
passed in both
[normal](https://vercel.com/vtest314-next-e2e-tests/vtest314-e2e-tests/DdaiGdGp9pjryuHiabhVVjYs7Yvx)
and
[feature-enabled](https://vercel.com/vtest314-next-e2e-tests/vtest314-e2e-tests/AfLpVfJ7k73hKBjXyfixrKY7omvY)
modes. Both installations used the declared pnpm 10.33.0 through
Corepack. The feature-enabled build reported Cache Components and cached
navigations enabled; inspection of the deploy setup confirmed the same
captured Cache Components, partial-prefetching, and cached-navigation
assignments appended to both root and nested configs.

### CI refresh

The initial Actions run for the helper refactor started before the PR
was retargeted, so it tested a merge against `canary` (`d5d747e9`) and
failed in upstream `param-matching-ensure-static` suites outside this
PR. Commit `0f494fea20` has exactly the same source tree as the
validated helper refactor and triggers a fresh run against the fourth
layer's parent, #99395. The targeted Nx deployment results above still
apply to this unchanged tree.

<!-- NEXT_JS_LLM -->
parent 1a183ebd
import { nextTestSetup, isNextDev } from 'e2e-utils' import {
nextTestSetup,
isNextDev,
patchFileWithDeployEnvAssignments,
} from 'e2e-utils'
import 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('nx-handling', () => { describe('nx-handling', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
overrideFiles: {
'apps/next-nx-test/next.config.js': patchFileWithDeployEnvAssignments(
path.join(__dirname, 'apps/next-nx-test/next.config.js')
),
},
env: {
ENABLE_EXPERIMENTAL_COREPACK: '1',
},
buildCommand: 'pnpm run build', buildCommand: 'pnpm run build',
startCommand: isNextDev ? 'pnpm run dev' : 'pnpm run start', startCommand: isNextDev ? 'pnpm run dev' : 'pnpm run start',
packageJson: { packageJson: {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
}, },
{ {
"plugin": "@nx/next/plugin", "plugin": "@nx/next/plugin",
"include": ["apps/**/next.config.*"],
"options": { "options": {
"startTargetName": "start", "startTargetName": "start",
"buildTargetName": "build", "buildTargetName": "build",
......
{
"outputDirectory": "dist/apps/next-nx-test/.next"
}
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