Skip to content

test(node): Migrate http client span tests to createCjsTests#21956

Merged
mydea merged 1 commit into
developfrom
fn/migrate-http-client-integration-tests
Jul 6, 2026
Merged

test(node): Migrate http client span tests to createCjsTests#21956
mydea merged 1 commit into
developfrom
fn/migrate-http-client-integration-tests

Conversation

@mydea

@mydea mydea commented Jul 3, 2026

Copy link
Copy Markdown
Member

Moves the nine tracing/http-client-spans/* suites onto the shared createCjsTests runner helper, splitting each inline scenario.ts into an instrument.mjs (Sentry.init) + scenario.mjs pair.

Each suite keeps its own instrument config and runs in CJS, matching its previous run mode:

  • fetch-basic, fetch-strip-query, fetch-error, http-basic, http-strip-query — basic init
  • fetch-basic-streamedtraceLifecycle: 'stream'
  • fetch-forward-request-hooknativeNodeFetchIntegration request/response hooks
  • fetch-headers-to-span-attributesnativeNodeFetchIntegration header mapping
  • http-otel-double-instrumentation — shares one scenario.mjs across two instruments (instrument.mjs with debug: true, and instrument-mitigation.mjs with httpIntegration({ spans: false })), each registering the OTel HttpInstrumentation to reproduce and mitigate the double-span case

No coverage change — every suite runs in the same (CJS) module format it did before, with assertions preserved verbatim.

🤖 Generated with Claude Code

Move the nine `tracing/http-client-spans/*` suites onto the shared
`createCjsTests` runner helper, splitting each inline `scenario.ts` into an
`instrument.mjs` (`Sentry.init`) + `scenario.mjs` pair. Each suite keeps its
own instrument config (tracesSampleRate, traceLifecycle, fetch/http
integration options, debug) and runs in CJS as before.

The `http-otel-double-instrumentation` suite now shares one `scenario.mjs`
between its two instruments (`instrument.mjs` with debug, and
`instrument-mitigation.mjs` with `httpIntegration({ spans: false })`), each of
which registers the OTel `HttpInstrumentation` to reproduce the
double-instrumentation case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea mydea requested a review from a team as a code owner July 3, 2026 12:12
@mydea mydea requested review from JPeer264 and andreiborza and removed request for a team July 3, 2026 12:12
@mydea mydea merged commit 9d53b0c into develop Jul 6, 2026
97 of 99 checks passed
@mydea mydea deleted the fn/migrate-http-client-integration-tests branch July 6, 2026 09:39
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.

2 participants