Skip to content

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

Open
JPeer264 wants to merge 5 commits into
developfrom
jp/node-suites-runtime-switch
Open

JPeer264 wants to merge 5 commits into
developfrom
jp/node-suites-runtime-switch

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 23, 2026

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 to only some node tests (more will follow in the stack). 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 #24052 and #23889.

🤖 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.24 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.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.45 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.2 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.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.42 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.73 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.44 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.77 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.95 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.88 kB +0.01% +7 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.4 kB - -
@sentry/node - without tracing 90.43 kB +0.02% +17 B 🔺
@sentry/node - without channel injection 112.41 kB +0.01% +11 B 🔺
@sentry/aws-serverless 98.7 kB +0.01% +8 B 🔺
@sentry/cloudflare (withSentry) - minified 206.49 kB - -
@sentry/cloudflare (withSentry) 513.73 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 3 times, most recently from b1b40cb to 5ee62e2 Compare September 23, 2026 12:24
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 5ee62e2 to a42772a Compare September 23, 2026 13:23
… Deno

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 marked this pull request as ready for review September 23, 2026 14:39
@JPeer264
JPeer264 requested a review from a team as a code owner September 23, 2026 14:39
@JPeer264
JPeer264 requested review from andreiborza, isaacs and mydea and removed request for a team September 23, 2026 14:39
@JPeer264
JPeer264 removed this pull request from stack #24633 September 23, 2026 16:19
@JPeer264
JPeer264 added this pull request to stack #24670 September 23, 2026 16:19
@JPeer264
JPeer264 removed this pull request from stack #24670 September 23, 2026 17:26
@JPeer264
JPeer264 added this pull request to stack #24671 September 23, 2026 17:31

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some opportunities for a bit of polishing, this is great!

Comment thread dev-packages/deno-integration-tests/vite.config.mts
Comment thread dev-packages/node-integration-tests/utils/runner/createRunner.ts
Comment thread dev-packages/bun-integration-tests/node-suites/alias-sentry-bun.ts Outdated
Comment thread dev-packages/node-integration-tests/utils/index.ts Outdated
@isaacs

isaacs commented Sep 23, 2026

Copy link
Copy Markdown
Member

Failing e2e test is not related, afaict. Restarted with 🤞

JPeer264 and others added 3 commits September 24, 2026 11:10
… Deno

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

2 participants