Skip to content

Port Svelte E2E test app to span streaming #23815

Description

@andreiborza

Port this E2E test application to span streaming (1 app).

Apps

  • svelte-5

What to do

  1. Remove the traceLifecycle: 'static' pin added in test(e2e): Disable span streaming in e2e test applications #22590 from Sentry.init.
  2. Rewrite the specs from transaction envelopes to span v2:
    • waitForTransaction becomes waitForStreamedSpan / waitForStreamedSpans
    • event.transaction becomes span.name
    • contexts.trace.op becomes getSpanOp(span) plus span.is_segment
    • contexts.trace.data['x'] becomes span.attributes['x'], which has the shape { value, type }
    • transaction_info.source becomes the sentry.segment.name.source attribute
  3. Streamed child spans arrive across several envelopes, so use collectStreamedSpans wherever a test asserts on children of a segment span.

This is plain Svelte with no router, so the pageload span falls back to the low-cardinality Pageload name instead of the URL path.

Reference app: react-router-7-spa-streaming. Worked example: #23797.

Keep static trace lifecycle coverage

Duplicate svelte-5 as-is into svelte-5-static and leave that copy on the current transaction-based specs. That keeps the static trace lifecycle covered once this app moves to streaming.

The copy is verbatim; only the app name changes:

  • package.json -> name
  • start-event-proxy.mjs -> proxyServerName
  • every waitForTransaction / waitForError / waitForSession call in tests/

Keep traceLifecycle: 'static' in the copy's Sentry.init calls. The e2e matrix discovers apps by directory, so no CI config change is needed.

Metadata

Metadata

Assignees

Labels

TaskjavascriptPull requests that update javascript code

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions