next.js
f196a3a5 - test: add non-adapter deploy snapshots to otel-middleware-trace (#100583)

Commit
4 days ago
test: add non-adapter deploy snapshots to otel-middleware-trace (#100583) ### What? Adds snapshots for deployments built without the adapter to `test/e2e/app-dir/otel-middleware-trace/otel-middleware-trace.test.ts`. Test-only change. ### Why? The v16.5.0-canary.23 release deploy tests ([run 39773330104](https://github.com/vercel/next.js/actions/runs/39773330104)) fail 20 of 30 tests in this file, on every retry, in `Run Deploy Tests (Turbopack)` and `Run Deploy Tests (Webpack)`. Those jobs deploy with `NEXT_ENABLE_ADAPTER=0`. The deploy snapshots were filled from PR CI, which deploys only through the adapter (`NEXT_ENABLE_ADAPTER=1`). `Run Deploy Adapter Tests` passes the same file. Without the adapter, the trace topology is the same: one trace, and the middleware and render are siblings under `Next.request` or the incoming context. Only the render's spans have the self-hosted shape: - the request span is unnamed (`GET` instead of `GET /page/page`); - `findPageComponents` → `loadRouteModule` spans appear; - the render's `instrumentation.ts` lifecycle spans are startup roots. Node.js middleware still emits its lifecycle spans inside the middleware span. ### How? - **Builder flag.** A new `isNonAdapterDeploy` flag selects non-adapter snapshots for deployments without the adapter, in the default render mode. - The snapshots are the complete received trees from that run. They were identical across Turbopack and Webpack and all 3 attempts. - The lifecycle-span test reuses the existing self-hosted snapshot. - **Existing snapshots unchanged.** All adapter, self-hosted and Cache Components snapshots stay as they are. Non-adapter deployments with Cache Components keep the existing assertions, because the release suite doesn't run that combination, so there's no observed tree to assert. - **No coverage dropped.** No deployment skips or known-failure entries. Verification: - **Mechanical checks.** The new literals were checked against the trees reconstructed from the CI logs. A check of which snapshot each of the 192 test/environment combinations selects confirms that only default-mode non-adapter deployments change. - **Local runs.** `test-start-turbo`, `test-dev-turbo` and `test-start-webpack` pass with no snapshot changes. - **Not confirmed by PR CI.** PR CI deploys only through the adapter, so it doesn't exercise the new snapshots. The next release deploy run confirms them. <!-- NEXT_JS_LLM --> <!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e --> Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com> Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Author
Parents
Loading