Skip to content

test(e2e): Port React Router E2E test apps to span streaming - #23839

Closed
andreiborza wants to merge 1 commit into
developfrom
ab/js-3482-port-react-router-e2e-to-span-streaming
Closed

test(e2e): Port React Router E2E test apps to span streaming#23839
andreiborza wants to merge 1 commit into
developfrom
ab/js-3482-port-react-router-e2e-to-span-streaming

Conversation

@andreiborza

Copy link
Copy Markdown
Member

What

Ports the 17 React Router E2E test applications to span streaming and adds react-router-7-framework-static to keep static trace lifecycle coverage.

  • Removed the traceLifecycle: 'static' pin from every Sentry.init in the 17 apps
  • Rewrote the specs against streamed span v2 (waitForStreamedSpan / collectStreamedSpans, span.name, getSpanOp, span.attributes)
  • Re-exported SerializedStreamedSpan from @sentry-internal/test-utils

Why

Span streaming is the default now, so the E2E suite has to exercise it. A few assertions could not carry over unchanged: LCP is a separate ui.webvital.lcp span instead of lcp.* attributes on the pageload span, the navigator attributes are renamed (device.memory.estimated_capacity, device.processor_count, network.connection.effective_type, browser.performance.*), mysql spans are named after the query summary, http.client spans carry only the domain, and spans have no breadcrumbs or tags. Those tests now assert on the attribute that still identifies the case. The static copy drops the latest build variant so it adds one CI job, not two.

Closes: #23798

Removes the `traceLifecycle: 'static'` pin from the 17 React Router E2E test
applications and rewrites their specs against streamed span v2 payloads.

Adds `react-router-7-framework-static` as a copy of `react-router-7-framework`
that keeps the static trace lifecycle, so that path stays covered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 1, 2026

Copy link
Copy Markdown

JS-3482

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3ea1d9b. Configure here.

getSpanOp(span) === 'resource.script' &&
span.attributes['sentry.origin']?.value === 'auto.resource.browser.metrics',
);
expect(resourceSpans.length).toBeGreaterThanOrEqual(2);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lazy navigation counts pageload scripts

Medium Severity

collectStreamedSpans is started before page.goto('/'), so the later resource.script filter includes pageload bundle spans as well as lazy-navigation chunks. The toBeGreaterThanOrEqual(2) check can pass even when navigation never emits those lazy-route spans, so a regression in lazy navigation instrumentation would go unnoticed. Flagged because the review guidelines require tests to actually cover the behaviour they claim to check.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 3ea1d9b. Configure here.

await linkElement.click();

const spans = await spansPromise;
const navigationSpan = spans.find(span => span.is_segment)!;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong segment picked for navigation

Medium Severity

The wait predicate requires a navigation segment, but the span under test is then selected with spans.find(span => span.is_segment). That envelope can also contain the still-finishing pageload segment, especially here because the click is not sequenced after pageload. Memory-router is most exposed because pageload and navigation share the name /user/:id. Flagged from the review guidelines on flaky waits that are not unique enough when telemetry can arrive in arbitrary order.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 3ea1d9b. Configure here.

const childSpans = spans.filter(
span => !span.is_segment && !(span.attributes['url.full']?.value as string | undefined)?.includes('favicon'),
);
expect(childSpans).toEqual([]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Child-span absence checked too narrowly

Medium Severity

These tests expect navigation to have no child spans, but they only inspect the single envelope that contains the navigation segment. Streamed children flush as they end, often in earlier envelopes, so unexpected children would not be seen and the empty-array assertion would still pass. Flagged because the review guidelines call out relaxed negative assertions that do not actually prove something is absent from the payload.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 3ea1d9b. Configure here.

@andreiborza

Copy link
Copy Markdown
Member Author

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.56 kB -4.27% -1.27 kB 🔽
@sentry/browser - with treeshaking flags 26.92 kB -3.95% -1.11 kB 🔽
@sentry/browser (incl. Tracing) 48.86 kB +3.41% +1.61 kB 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.87 kB +3.37% +1.59 kB 🔺
@sentry/browser (incl. Tracing, Profiling) 51.79 kB -0.41% -210 B 🔽
@sentry/browser (incl. Tracing, Replay) 88.35 kB +2.04% +1.76 kB 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.75 kB +2.3% +1.74 kB 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 93.04 kB +1.93% +1.76 kB 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 106 kB +1.98% +2.05 kB 🔺
@sentry/browser (incl. Feedback) 46.05 kB -2.31% -1.09 kB 🔽
@sentry/browser (incl. sendFeedback) 33.62 kB -3.02% -1.04 kB 🔽
@sentry/browser (incl. FeedbackAsync) 38.73 kB -2.64% -1.05 kB 🔽
@sentry/browser (incl. Metrics) 29.51 kB -4.53% -1.4 kB 🔽
@sentry/browser (incl. Logs) 29.8 kB -4.32% -1.34 kB 🔽
@sentry/browser (incl. Metrics & Logs) 30.43 kB -4.35% -1.38 kB 🔽
@sentry/react 30.3 kB -4.19% -1.32 kB 🔽
@sentry/react (incl. Tracing) 51.06 kB +3.13% +1.55 kB 🔺
@sentry/vue 35.73 kB +2.31% +806 B 🔺
@sentry/vue (incl. Tracing) 51.13 kB +3.84% +1.89 kB 🔺
@sentry/svelte 28.59 kB -4.25% -1.27 kB 🔽
CDN Bundle 30.35 kB -4.79% -1.52 kB 🔽
CDN Bundle (incl. Tracing) 49.5 kB +4.14% +1.96 kB 🔺
CDN Bundle (incl. Logs, Metrics) 32.58 kB -2.5% -834 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 51.41 kB +5.04% +2.46 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.17 kB +0.59% +425 B 🔺
CDN Bundle (incl. Tracing, Replay) 87 kB +2.13% +1.81 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.86 kB +2.74% +2.36 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.93 kB +2.11% +1.92 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.83 kB +2.73% +2.51 kB 🔺
CDN Bundle - uncompressed 89.95 kB -4.94% -4.67 kB 🔽
CDN Bundle (incl. Tracing) - uncompressed 147.56 kB +3.83% +5.44 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.24 kB -3.02% -3 kB 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.25 kB +4.9% +7.15 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB +0.66% +1.47 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.05 kB +2.18% +5.67 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.73 kB +2.79% +7.38 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.75 kB +2.07% +5.67 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.42 kB +2.65% +7.38 kB 🔺
@sentry/nextjs (client) 53.68 kB +3.08% +1.6 kB 🔺
@sentry/sveltekit (client) 49.29 kB +3.32% +1.58 kB 🔺
@sentry/core/server 40.72 kB -37.85% -24.8 kB 🔽
@sentry/core/browser 13.42 kB -74.13% -38.46 kB 🔽
@sentry/node 123.83 kB +2.99% +3.59 kB 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.4 kB added added
@sentry/node - without tracing 88.13 kB +5.31% +4.44 kB 🔺
@sentry/aws-serverless 96.48 kB +4.47% +4.12 kB 🔺
@sentry/cloudflare (withSentry) - minified 201.21 kB -7.98% -17.44 kB 🔽
@sentry/cloudflare (withSentry) 500.7 kB -7.09% -38.15 kB 🔽
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB added added
@sentry/node - without channel injection 103.26 kB added added

View base workflow run

@andreiborza andreiborza closed this Sep 1, 2026
@andreiborza
andreiborza deleted the ab/js-3482-port-react-router-e2e-to-span-streaming branch September 1, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port React Router E2E test apps to span streaming

1 participant