Skip to content

test(bun, deno): Run shared Node integration suites on Bun and Deno - #24609

Draft
JPeer264 wants to merge 1 commit into
developfrom
jp/node-suites-runtime-switch
Draft

JPeer264 wants to merge 1 commit into
developfrom
jp/node-suites-runtime-switch

Conversation

@JPeer264

Copy link
Copy Markdown
Member

Bun and Deno each had only a handful of integration suites, so most SDK behavior was only tested on Node. This lets the Bun and Deno integration packages run the Node suites themselves instead of copying them: the Node runner reads a RUNTIME env var and maps Node's preload flags to the other runtime, and each runtime package selects Node suites in its Vitest config.

Single tests that a runtime does not support are skipped with test.skipIf on RUNTIME inside the Node suite, so the reason sits next to the test. On Bun the suites run twice: with @sentry/node, which is what meta-framework SDKs use on Bun, and with @sentry/node mapped to @sentry/bun.

This PR opts in public-api, client-reports and featureFlags only. It also makes the runner robust enough for slower runtimes: a longer wait for the server port on Bun and Deno, and SIGKILL after SIGTERM, because on Deno a SIGTERM listener keeps a scenario alive after its test.

Part of JS-3587 and JS-3515.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Sep 23, 2026

Copy link
Copy Markdown

JS-3515

JS-3587

@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.23 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.16 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.16 kB - -
@sentry/browser (incl. Tracing, Replay) 90.75 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.85 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.45 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.42 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.29 kB - -
@sentry/browser (incl. FeedbackAsync) 39.39 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.5 kB - -
@sentry/browser (incl. Metrics & Logs) 31.17 kB - -
@sentry/react 30.98 kB - -
@sentry/react (incl. Tracing) 53.44 kB - -
@sentry/vue 36.72 kB - -
@sentry/vue (incl. Tracing) 53.69 kB - -
@sentry/svelte 29.25 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.19 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.27 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.43 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.4 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.76 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.72 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.5 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.43 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.13 kB - -
@sentry/nextjs (client) 55.78 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.92 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.88 kB +0.02% +16 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.4 kB - -
@sentry/node - without tracing 90.39 kB +0.01% +7 B 🔺
@sentry/node - without channel injection 112.42 kB +0.02% +21 B 🔺
@sentry/aws-serverless 98.71 kB +0.03% +22 B 🔺
@sentry/cloudflare (withSentry) - minified 206.38 kB - -
@sentry/cloudflare (withSentry) 513.49 kB - -

View base workflow run

Base automatically changed from jp/bun-cjs-init-throws to develop September 23, 2026 06:14
@JPeer264
JPeer264 added this pull request to stack #24613 September 23, 2026 06:14
@JPeer264
JPeer264 force-pushed the jp/node-suites-runtime-switch branch 3 times, most recently from 1a1632c to 0156f20 Compare September 23, 2026 08:27
@JPeer264
JPeer264 removed this pull request from stack #24613 September 23, 2026 09:51
@JPeer264
JPeer264 added this pull request to stack #24633 September 23, 2026 09:51
@JPeer264
JPeer264 force-pushed the jp/node-suites-runtime-switch branch from 0156f20 to 05ab775 Compare September 23, 2026 10:02
The Node integration runner now reads a `RUNTIME` env var (`node`, `bun`
or `deno`) and spawns the scenario with that binary. Node preload flags
become `--preload` on Bun and Deno. Deno also gets an import map for the
test helpers, CommonJS detection, and bare Node builtins, because the
workspace symlinks put the SDK packages outside `node_modules`.

The Bun and Deno integration packages select Node suites in their Vitest
configs, so the same scenarios run on all 3 runtimes without copies. Bun
runs them twice: with `@sentry/node`, and with `@sentry/node` mapped to
`@sentry/bun` by a preload. Single tests that a runtime does not support
use `test.skipIf` on `RUNTIME`.

The runner also waits longer for a server port on Bun and Deno, which
start the SDK more slowly than Node, and it follows `SIGTERM` with
`SIGKILL`: on Deno a `SIGTERM` listener (the Vercel integration has one)
keeps a scenario alive after its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/node-suites-runtime-switch branch from 05ab775 to b1b40cb Compare September 23, 2026 10:04

This branch has not been deployed

No deployments
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.

1 participant