test(cloudflare): Port the binding suites to span streaming - #24190
Draft
JPeer264 wants to merge 1 commit into
Draft
test(cloudflare): Port the binding suites to span streaming#24190JPeer264 wants to merge 1 commit into
JPeer264 wants to merge 1 commit into
Conversation
Removes the `traceLifecycle: 'static'` pin from `suites/d1`, `suites/r2`,
`suites/queue`, `suites/prisma`, `suites/durableobject/error`,
`suites/workflows/step-context` and `suites/vite/diagnostics-channel/vercelai-6`,
and rewrites the assertions from transaction envelopes to span v2.
`durableobject/error` and `workflows/step-context` only assert on error events,
so the pin is all that goes. `cache-client` and `durableobject-scope` were
already unpinned; they drop `transaction` from their ignore list, which is now an
envelope type nothing emits.
The binding spans keep the shape they had, and only the encoding changes: a span
carries its name in `name` rather than `description`, its op and origin as
attributes, and every attribute as a `{ type, value }` pair. The r2 and queue
suites therefore keep one envelope expectation per request.
Two things do change.
D1 and Prisma spans are `db.query`, so streaming names them after
`db.query.summary`. `SELECT * FROM users WHERE id = ?` becomes `SELECT users`.
The Prisma suite loses the description-based split between its two `SELECT`
spans, which now share the name `SELECT main.User`, so the D1 one is picked by its
op and the traceparent comment is asserted on `db.query.text` instead.
`prisma` and `vercelai-6` collect until the whole trace is in hand, seventeen spans
and three. Both assert on the complete child set of one request, and the span
buffer flushes on a timer, so reading a single envelope would be a race. Waiting
for the segment span would be one too: it ends last, but each envelope is its own
request to the mock server, so it can arrive before its children do.
`vercelai-6` also drops the separate span container it used to read next to the
transaction item: a streamed gen_ai span is an ordinary item of the one span
envelope.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the binding suites off the
traceLifecycle: 'static'pin:d1,r2,queue,prisma,durableobject/error,workflows/step-contextandvite/diagnostics-channel/vercelai-6.durableobject/errorandworkflows/step-contextonly assert on error events, so the pin is all that goes.cache-clientanddurableobject-scopewere already unpinned and keep ignoring spans, so they are untouched.Most binding spans keep the shape they had and only the encoding changes, so the r2 and queue suites keep one envelope expectation per request. Two things do change.
D1 and Prisma spans carry the
db.queryop, so streaming names them afterdb.query.summary:SELECT * FROM users WHERE id = ?becomesSELECT users. The Prisma suite loses the description-based split between its twoSELECTspans, which now share the nameSELECT main.User. The D1 one is picked by its op instead, and the traceparent comment that used to be matched on the description is asserted ondb.query.text.prismaandvercelai-6switch tocollectStreamedSpansUntilSegment. Both assert on the complete child set of one request and the span buffer flushes on a timer, so reading a single envelope would be a race.vercelai-6also drops the separate span container it used to read next to the transaction item: a streamed gen_ai span is an ordinary item of the one span envelope./keeps itsGET /name under streaming (the source isroute, noturl), sovercelai-6waits on that rather than the bare method the raw-URL suites see.Part of #24148
🤖 Generated with Claude Code