Skip to content

test(bun): Run all Node integration suites on Bun - #24610

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

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

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Bun now runs every Node suite except an explicit exclude list, grouped by cause, so a new Node test runs on Bun by default and a gap shows up as a failing test rather than as missing coverage. Excluded files do not run, which keeps the job fast even though most exclusions would otherwise wait for a timeout.

The exclude groups document what @sentry/node currently cannot do on Bun: no http.server span (Bun does not publish http.server.request.start), no fetch spans (Bun's fetch does not use undici), no outgoing node:http instrumentation on Bun 1.3.14 (#23881), and no auto-instrumentation under bun run (#23882). The list is based on Bun 1.3.14, the version CI pins; several suites already pass on newer Bun.

The suites that assert the SDK name use EXPECTED_SDK_NAME, so they also pass in the @sentry/bun project.

FWIW in a later PR more tests will be enabled as Bun will then run Bun.build before - see #24612

Part of #23889.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Sep 23, 2026

Copy link
Copy Markdown

JS-3515

@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 136.65 kB +0.02% +14 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.56 kB - -
@sentry/node - without tracing 90.58 kB +0.02% +14 B 🔺
@sentry/node - without channel injection 115.09 kB +0.01% +9 B 🔺
@sentry/aws-serverless 98.85 kB +0.01% +3 B 🔺
@sentry/cloudflare (withSentry) - minified 206.49 kB - -
@sentry/cloudflare (withSentry) 513.73 kB - -

View base workflow run

@JPeer264
JPeer264 added this pull request to stack #24613 September 23, 2026 06:14
@JPeer264
JPeer264 force-pushed the jp/node-suites-bun branch 2 times, most recently from 9099fef to 34ea3db 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-bun branch 4 times, most recently from 1feee30 to 278df2a Compare September 23, 2026 16:19
@JPeer264
JPeer264 removed this pull request from stack #24633 September 23, 2026 16:19
@JPeer264
JPeer264 changed the base branch from jp/node-suites-runtime-switch to jp/node-suites-bun-shared-runner September 23, 2026 16:19
@JPeer264
JPeer264 added this pull request to stack #24670 September 23, 2026 16:19
@JPeer264
JPeer264 marked this pull request as ready for review September 23, 2026 16:42
@JPeer264
JPeer264 requested a review from a team as a code owner September 23, 2026 16:42
@JPeer264
JPeer264 requested review from isaacs and mydea and removed request for a team September 23, 2026 16:42
@JPeer264 JPeer264 self-assigned this Sep 23, 2026
@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.

One minor-ish confusing thing I think probably should be fixed (if I'm understanding accurately what's going on), but otherwise this is fine.

Comment thread dev-packages/bun-integration-tests/vite.config.mts
@JPeer264
JPeer264 force-pushed the jp/node-suites-bun branch 3 times, most recently from c4ddeec to e986b27 Compare September 24, 2026 14:19
@JPeer264
JPeer264 requested a review from isaacs September 25, 2026 08:28
Base automatically changed from jp/node-suites-bun-shared-runner to develop September 25, 2026 15:41
JPeer264 and others added 4 commits September 25, 2026 18:41
The Bun package now selects every Node suite and excludes the ones that
fail on Bun, grouped by cause: Node-only features, no `http.server` span
because Bun does not publish `http.server.request.start`, no `fetch`
instrumentation because Bun's `fetch` does not publish undici channels,
no outgoing `node:http` instrumentation on Bun 1.3.14 (JS-3507), and no
auto-instrumentation under `bun run` (JS-3508). Excluded files do not
run, so the job stays fast. The list is based on Bun 1.3.14, the version
CI pins.

The suites that assert the SDK name use `EXPECTED_SDK_NAME`, so they
also pass with `@sentry/bun`, and `bun-runtime-metrics` runs on Bun
instead of Node.

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

@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.

This is great! Love to see our tests come together like this, it's so validating of the overall architectural work we've been doing the last few months.

Approved because the only really blocking concern (the prisma failure) is being caught by CI anyway, so fix that and we're good 👍

The other relevant concern is that some tests actually are being dropped that were run before. I thought at first it'd be a tiny couple-line patch to pull them back in, but it's a bit more involved. If you wanna do that as a followup, that's fine, but it could also just go in here, I think.

'suites/tracing/postgresjs/test.ts',
'suites/tracing/prisma-orm-v5/test.ts',
'suites/tracing/prisma-orm-v6/test.ts',
'suites/tracing/prisma-orm-v7/test.ts',

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.

This is why the CI is failing, because a new test was added on develop, but not here.

Obviously, once this lands, it'll be less of an issue. But, in addition to adding it to the set right now, I think we can help prevent the footgun that exposes.

I'd recommend:

  • Add a line in dev-packages/node-integration-tests/README.md, like "When adding a test to this suite, also consider whether that test can run properly on Bun. If not, create an exclusion in dev-packages/bun-integration-tests/node-suites/excludes.ts."
  • This could also maybe be added to our skills which mention node-integration-tests (maybe just tell them to be sure to check the readme?)
    • .claude/skills/add-ai-integration/SKILL.md
    • .claude/skills/vendor-otel/SKILL.md
    • .claude/skills/write-tests/SKILL.md
Suggested change
'suites/tracing/prisma-orm-v7/test.ts',
'suites/tracing/prisma-orm-v7/test.ts',
'suites/tracing/prisma-orm-v8/test.ts',

max?: number;
}): typeof describe | typeof describe.skip {
// Vitest always runs on Node, so its Node version says nothing about Bun or Deno running the
// scenario. Those runtimes list the suites they cannot run in their own exclude lists.

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.

Might also want to add a line here to say that a file with a complementary min/max gate will not work properly on Bun, and must be excluded in dev-packages/bun-integration-tests/node-suites/excludes.ts.


// `@sentry/node` instruments `fetch` through undici's diagnostics channels, which Bun's `fetch`
// does not publish. `@sentry/bun` has its own `fetchIntegration` for this.
const NO_FETCH_INSTRUMENTATION = [

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.

The way this is structured right now, bun's fetchIntegration tests don't actually run.

It's a little complicated to explain in ye olde englishe, so I wrote up a patch that would bring the lost coverage. It's a little complicated, there might be an opportunity to simplify it down a bit, or if you think it's cleaner, we could do as a followup. But I think it's important to not lose test coverage in the end, if possible.

https://gist.github.com/isaacs/06a374f207bca343b51d9ad831485b7b

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.

(Same for http.server tests. Updated gist.)


describe('bunRuntimeMetricsIntegration', () => {
// The integration measures the Bun process, so the suite runs on Bun only.
describe.skipIf(RUNTIME !== 'bun')('bunRuntimeMetricsIntegration', () => {

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.

Can we move this test to dev-packages/bun-integration-tests, and then remove this skipIf condition?

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