test(e2e): Port the nestjs-basic E2E app to span streaming - #24099
Merged
Conversation
Removes the `traceLifecycle: 'static'` pin and rewrites the specs against streamed spans. Two things did not port mechanically. `waitForStreamedSpan` gains the optional `timestamp` parameter `waitForEnvelopeItem` already has, because the `app_creation` span is emitted at startup, before any spec can start listening. And streamed spans carry no breadcrumbs, so `/test-schedule-isolation` reports whether a scheduled task's breadcrumb leaked into its isolation scope as a span attribute, the same way the Next.js middleware specs do. Ref: #23801 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
Member
Author
|
bugbot run |
…wrapper The local `waitForSegmentSpan` only re-expressed what `collectStreamedSpansUntilSegment` and `waitForStreamedSpan` already do, and was copied into every ported app. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9296321. Configure here.
chargome
marked this pull request as ready for review
September 7, 2026 09:36
Switches the span assertions from `toMatchObject` to `toEqual` so an unexpected field or attribute fails the test, as the transaction-based specs did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI builds the apps with a release, so every span carries `sentry.release` there and none locally, which the exhaustive attribute matching tripped over. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
andreiborza
approved these changes
Sep 8, 2026
nicohrubec
approved these changes
Sep 8, 2026
| @@ -1,745 +1,412 @@ | |||
| import { expect, test } from '@playwright/test'; | |||
Member
There was a problem hiding this comment.
I guess at some point we should rename these files to spans.test.ts or trace.test.ts or similar
The file asserts on streamed spans, not transaction events, and `spans.test.ts` is what the other streaming apps already call it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
chargome
enabled auto-merge (squash)
September 8, 2026 10:00
chargome
added a commit
that referenced
this pull request
Sep 9, 2026
…24211) Both specs of each interceptor route produce a trace with the same segment name, and `collectStreamedSpans` resolves with any trace satisfying the predicate, so a leftover trace from the preceding spec could satisfy it instead. Each request now carries a `spec` query marker, which lands in `url.query` and not in the span name. This was meant to ship with #24099 but landed on the branch after it merged. Ref: #23801 Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
Removes the
traceLifecycle: 'static'pin and rewrites the specs against streamed spans.Two things did not port mechanically.
waitForStreamedSpangains the optionaltimestampparameterwaitForEnvelopeItemalready has, because theapp_creationspan is emitted at startup, before any spec can start listening. And streamed spans carry no breadcrumbs, so/test-schedule-isolationreports whether a scheduled task's breadcrumb leaked into its isolation scope as a span attribute, the same way the Next.js middleware specs do.Ref: #23801
🤖 Generated with Claude Code