Skip to content

ci: run changed deploy tests with both builders - #100591

Merged
sokra merged 2 commits into
canaryfrom
fleet/deploy-new-tests-non-adapter
Oct 27, 2026
Merged

sokra merged 2 commits into
canaryfrom
fleet/deploy-new-tests-non-adapter

Conversation

@sokra

@sokra sokra commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What?

Run new and changed deploy tests in PR CI for both deploy builders, and fold the separate cache-components job into the same matrix:

  • builder: adapter (NEXT_ENABLE_ADAPTER=1, current behavior) and non-adapter (NEXT_ENABLE_ADAPTER=0)
  • cache-components: false / true (replaces the separate test-new-tests-deploy-cache-components job)

test-new-tests-deploy now runs group (5) × builder (2) × cache components (2) = 20 entries. Per entry, the env and command are the same as before:

  • cache components off sets __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true
  • cache components on sets __NEXT_CACHE_COMPONENTS, __NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS and the combined NEXT_EXTERNAL_TESTS_FILTERS

Adapter entries keep their existing stepNames, so their test-report and Datadog history continues. Non-adapter entries get a -non-adapter suffix. Job names include the variant, builder and group.

Why?

The release deploy tests run both builders, but PR CI only checked new and changed deploy tests against the adapter. Changes that behave differently with the non-adapter builder were only caught after release. A recent example is a resume-data-cache.partial-prefetching failure that only showed up in the non-adapter Turbopack release shards.

How?

  • Parsed the workflow and expanded the matrix to 20 entries. Each rendered afterBuild script was run in an empty environment with node stubbed out. Every entry exports the same env and runs the same command, stepName and display name as the matching entry from the previous two jobs. The rest of the workflow is unchanged.
  • prettier --check .github/workflows/build_and_test.yml

@github-actions github-actions Bot added the created-by: Turbopack team PRs by the Turbopack team. label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 22285e1

@sokra
sokra requested a review from mischnic October 22, 2026 15:34
Comment thread .github/workflows/build_and_test.yml Resolved
@sokra
sokra marked this pull request as ready for review October 23, 2026 04:50
@sokra
sokra force-pushed the fleet/deploy-new-tests-non-adapter branch from abe2b74 to 22285e1 Compare October 23, 2026 08:26
@sokra
sokra added this pull request to stack #100667 October 23, 2026 15:41
@sokra
sokra removed this pull request from stack #100667 October 24, 2026 06:10
@sokra
sokra added this pull request to stack #100691 October 24, 2026 06:10
@sokra
sokra merged commit 324b297 into canary Oct 27, 2026
131 checks passed
@sokra
sokra deleted the fleet/deploy-new-tests-non-adapter branch October 27, 2026 13:18
sokra added a commit that referenced this pull request Oct 28, 2026
…0824)

### What?

Drop the non-adapter builder + cache components combination from the
"Test new and changed tests when deployed" PR matrix. The matrix had 20
entries (group × builder × cache components); it now has 15:

- adapter, cache components off
- adapter, cache components on
- non-adapter, cache components off

### Why?

#100591 added the full builder × cache-components product. The release
deploy tests never run cache components with the non-adapter Turbopack
builder, so PR CI was testing a combination that release testing doesn't
cover.

### How?

The job gets a matrix `exclude` entry with a comment explaining why. The
remaining 15 entries keep their names, `stepName`s, env and commands, so
their report history continues. Nothing else in the workflow changes.

Verified by parsing the workflow and expanding the matrix with GitHub's
exclude rules. Every remaining rendered script was run with `node`
stubbed, and each one matches canary's env and command. The `exclude`
entry is the only difference from canary.

<!-- NEXT_JS_LLM -->


<!-- fleet 115592cd-38e9-4ec3-904b-f1c778e1e1d9 -->

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <[email protected]>
sokra added a commit that referenced this pull request Nov 5, 2026
…are-trace (#100664)

### What?

Test infrastructure for `test/e2e/app-dir/otel-middleware-trace`: the
fixture now writes span lifecycle events to the console, and tests
collect the **finished** spans of a request after the response, then
check that every span covers all spans below it.

### Why?

The fixture reported spans while they were still running (in an
`x-mw-spans` response header from inside the middleware, and in the page
or route body during rendering). Span timing couldn't be checked, so the
test couldn't see that the inserted `Next.request` root ends before its
render child. This is the baseline for the next PR in the stack, which
fixes that root.

### How?

- **Recorder** (`trace-recorder.ts`): a span processor writes one
`[otel-span] {json}` line per `start` and `end` event, with a unique
event ID. It works in the Node.js runtime, the Edge runtime and when
deployed.
- **Collection** (`test/lib/otel-span-capture.ts`):
- Self-hosted, it reads `next.cliOutput`. Deployed, it reads `vercel
logs --json` through a new `NextDeployInstance.getRuntimeLogs`, using a
paged reader in `test/lib/vercel-runtime-logs.ts`.
- Polls until each request's expected spans have ended, then a later
successful poll (at least the settle delay later) must find nothing new
for that request.
- Events are merged across polls; two distinct `end` events for one span
fail the test with a diagnostic.
- It fails with a diagnostic (tree so far, missing spans, poll history)
on timeout, rather than hanging or passing. A failed `vercel logs` read
is recorded and retried at the next poll; each call is capped at 60 s.
- Settling can't prove that no late log line arrives; that limitation is
documented in the helper.
- **Deployed: one collection per suite.** Each `describe` variant sends
every test's request in a `beforeAll` (in test order, so the first
request stays the cold one), then collects the spans of all of them in
one poll loop, with one unfiltered `vercel logs` read of the deployment
per poll. Each test then asserts on its own response and tree, so
failures stay per test. Self-hosted, each test still requests, collects
and asserts in turn. This replaced per-test polling, which added up the
ingestion delay and timed out late in the suite (1–3 tests per job on
the first deploy runs, including a hanging call and an API 504).
- **Diagnostics in every deployed run:** each `vercel logs` call is
logged (arguments with any token redacted, page, exit status, duration,
record count), and every captured `[otel-span]` event is printed once
with its times, so the raw data behind a tree is in the job log.
- **Envelope badges** (`printSpanTree`):
- A span gets `[error: doesn't cover descendants]` when a descendant
starts before it or ends after it, and `[error: not ended]` when it
hasn't ended.
- Times within the same millisecond count as covered, because the SDK
records times in whole milliseconds.
- `NextNodeServer.startResponse` is left out of the check, because its
timing against the render span is flaky. It's still printed.
- **Correlation:** a request's trace IDs come from an `x-mw-trace-id`
response header and the render's body. Incoming and middleware-set
`traceparent`s are new per request, so collection only sees that
request's spans.
- **Snapshots:** the snapshots now show complete trees, selected per
environment (mode, bundler, Cache Components, middleware entry).
- The only badge in the self-hosted snapshots is on next-server's
middleware-invoke root (`GET (BaseServer.handleRequest)`), which ends
before the render it is the parent of. Fixing it is out of scope here.
- The deploy snapshots are filled from complete CI trees, for both
builders (adapter and non-adapter) with and without Cache Components,
and both middleware runtimes. Their only badges are on the inserted `GET
(Next.request)` root of requests that continue to a render, which ends
before the render. The PR above fixes that. No deploy assertions are
skipped.
- **Rewrite edge cases:** three new tests trace a middleware rewrite to
an external origin (`https://example.vercel.sh`), to a static page
(`app/static`) and to an ISR page (`app/isr`, `revalidate = 3600`; with
Cache Components a `'use cache'` + `cacheLife('hours')` variant). They
assert the status, the page marker, that no internal headers leak, and
the tree. In `start`, the static and ISR pages are served from the cache
(no `render route (app)` span). The PR above shows what changes for them
deployed.
- In `dev, cache components`, the ISR tree has 2 more badges, on `GET
/isr` and `render route (app) /isr`. They come from Cache Components'
background validation, which renders again after the response, under the
render's context. #100690 (above) fixes that.
- **Span links:** the recorder also records each span's links, and
parsed spans carry them (not printed), so #100690 can assert its linked
validation root.
- No `packages/next` changes.

### Testing

The rewrite edge cases (36 tests / 34 snapshots) pass in all 6 local
modes (start/dev × turbo/webpack, Cache Components start/dev turbo).
Before the fixture changes they failed (404). Their deploy snapshots are
filled from CI. Deployed (both builders, with and without Cache
Components), all three trees are just `GET (Next.request)` with the
middleware span: the static and ISR pages are served without invoking a
function, so there are no render spans.

Earlier runs against the base framework without the PR above
(`otel-middleware-trace`, 30 tests / 28 snapshots):

| Mode | Runs |
|---|---|
| start turbo, dev turbo, start webpack | 2 each |
| Cache Components start turbo and dev turbo | 2 each |
| dev webpack | 1 |

All 11 runs passed, along with 41 unit tests
(`test/unit/otel-span-tree.test.ts`,
`test/unit/vercel-runtime-logs.test.ts`) and `pnpm typescript`. The
batch collection was also run locally by temporarily forcing it on for
self-hosted (start and dev turbo): same snapshots, including the cold
first request.

Stack: #100591 ← **this PR** ← #100690 ← #100665. Stacked on #100591, so
deploy CI runs this with both the adapter and the non-adapter builder.


<!-- 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 <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Turbopack team PRs by the Turbopack team. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants