-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
test(bun): Run all Node integration suites on Bun #24610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
+211
−58
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
152 changes: 152 additions & 0 deletions
152
dev-packages/bun-integration-tests/node-suites/excludes.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| // Node suites that do not run on Bun, relative to `node-integration-tests`. A single test that | ||
| // fails on Bun is skipped with `test.skipIf` on `RUNTIME` in the Node suite, not listed here. | ||
|
|
||
| // Node-only features: ANR and native thread watchdogs, child processes, the AWS Lambda Node runtime. | ||
| const NODE_ONLY = [ | ||
| 'suites/anr/test.ts', | ||
| 'suites/aws-serverless/**', | ||
| 'suites/breadcrumbs/**', | ||
| 'suites/child-process/test.ts', | ||
| 'suites/thread-blocked-native/test.ts', | ||
| ]; | ||
|
|
||
| // Bun does not publish `http.server.request.start`, so `@sentry/node` creates no `http.server` | ||
| // span and does not isolate incoming requests. `@sentry/bun` has `bunHttpServerIntegration` for this. | ||
| const NO_HTTP_SERVER_SPANS = [ | ||
| 'suites/sessions/**', | ||
| 'suites/tracing/envelope-header/sampleRate-propagation/test.ts', | ||
| 'suites/tracing/httpIntegration-streamed/test.ts', | ||
| 'suites/tracing/httpIntegration/test.ts', | ||
| 'suites/tracing/httpServerSpans-streamed-unrouted/test.ts', | ||
| 'suites/tracing/ignoreSpans-streamed/**', | ||
| 'suites/tracing/meta-tags-twp-errors/test.ts', | ||
| 'suites/tracing/meta-tags/test.ts', | ||
| 'suites/tracing/requestData-streamed/test.ts', | ||
| 'suites/tracing/sample-rand-propagation/test.ts', | ||
| 'suites/tracing/sample-rate-propagation/**', | ||
| 'suites/tracing/sampling-static/test.ts', | ||
| 'suites/tracing/sampling-streamed/test.ts', | ||
| 'suites/tracing/traceid-recycling-with-spans/test.ts', | ||
| 'suites/tracing/traceid-recycling/test.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 = [ | ||
| 'suites/tracing/double-baggage/**', | ||
| 'suites/tracing/http-client-span-streamed/test.ts', | ||
| 'suites/tracing/http-client-spans/fetch-basic-streamed/test.ts', | ||
| 'suites/tracing/http-client-spans/fetch-basic/test.ts', | ||
| 'suites/tracing/http-client-spans/fetch-error/test.ts', | ||
| 'suites/tracing/http-client-spans/fetch-forward-request-hook/test.ts', | ||
| 'suites/tracing/http-client-spans/fetch-headers-to-span-attributes/test.ts', | ||
| 'suites/tracing/http-client-spans/fetch-strip-query/test.ts', | ||
| 'suites/tracing/no-parent-span-client-report/test.ts', | ||
| 'suites/tracing/requests/fetch-breadcrumbs/test.ts', | ||
| 'suites/tracing/requests/fetch-no-trace-propagation/test.ts', | ||
| 'suites/tracing/requests/fetch-no-tracing-no-spans/test.ts', | ||
| 'suites/tracing/requests/fetch-no-tracing/test.ts', | ||
| 'suites/tracing/requests/fetch-sampled-no-active-span/test.ts', | ||
| 'suites/tracing/requests/fetch-unsampled/test.ts', | ||
| 'suites/tracing/requests/traceparent/test.ts', | ||
| ]; | ||
|
|
||
| // Bun 1.3.14 (the CI version) does not instrument outgoing `node:http` requests. These suites pass | ||
| // on Bun 1.4.2. See https://github.com/getsentry/sentry-javascript/issues/23881 | ||
| const NO_OUTGOING_HTTP_INSTRUMENTATION = [ | ||
| 'suites/tracing/dsc-txn-name-update/test.ts', | ||
| 'suites/tracing/http-client-spans/http-basic/test.ts', | ||
| 'suites/tracing/http-client-spans/http-strip-query/test.ts', | ||
| 'suites/tracing/requests/http-breadcrumbs/test.ts', | ||
| 'suites/tracing/requests/http-maxed-out-sockets/test.ts', | ||
| 'suites/tracing/requests/http-no-trace-propagation/test.ts', | ||
| 'suites/tracing/requests/http-no-tracing-no-spans/test.ts', | ||
| 'suites/tracing/requests/http-no-tracing/test.ts', | ||
| 'suites/tracing/requests/http-sampled-no-active-span/test.ts', | ||
| 'suites/tracing/requests/http-sampled/test.ts', | ||
| 'suites/tracing/requests/http-unsampled/test.ts', | ||
| 'suites/tracing/tracePropagationTargets/**', | ||
| ]; | ||
|
|
||
| // `bun run` cannot inject the diagnostics channels into libraries, so framework, database and AI | ||
| // instrumentation creates no spans. Apps must be built with `@sentry/bun/plugin`. | ||
| // See https://github.com/getsentry/sentry-javascript/issues/23882 | ||
| const NO_AUTO_INSTRUMENTATION = [ | ||
| 'suites/express/**', | ||
| 'suites/fs-instrumentation/test.ts', | ||
| 'suites/hono-sdk/test.ts', | ||
| 'suites/pino/test.ts', | ||
| 'suites/tracing/amqplib/test.ts', | ||
| 'suites/tracing/anthropic/test.ts', | ||
| 'suites/tracing/apollo-graphql/**', | ||
| 'suites/tracing/dataloader/test.ts', | ||
| 'suites/tracing/fastify/test.ts', | ||
| 'suites/tracing/genericPool-v2/test.ts', | ||
| 'suites/tracing/genericPool/test.ts', | ||
| 'suites/tracing/is-localhost/test.ts', | ||
| 'suites/tracing/google-genai-v2/test.ts', | ||
| 'suites/tracing/google-genai/test.ts', | ||
| 'suites/tracing/groq/test.ts', | ||
| 'suites/tracing/hapi/test.ts', | ||
| 'suites/tracing/ioredis-dc/test.ts', | ||
| 'suites/tracing/kafkajs/test.ts', | ||
| 'suites/tracing/knex/**', | ||
| 'suites/tracing/koa/test.ts', | ||
| 'suites/tracing/langchain/**', | ||
| 'suites/tracing/langgraph/test.ts', | ||
| 'suites/tracing/lru-memoizer/test.ts', | ||
| 'suites/tracing/mcp-handler-exact-once/test.ts', | ||
| 'suites/tracing/mcp-server-streamed/test.ts', | ||
| 'suites/tracing/mistral/test.ts', | ||
| 'suites/tracing/mongodb-v4/test.ts', | ||
| 'suites/tracing/mongodb-v5/test.ts', | ||
| 'suites/tracing/mongodb-v6/test.ts', | ||
| 'suites/tracing/mongodb-v7/test.ts', | ||
| 'suites/tracing/mongodb/test.ts', | ||
| 'suites/tracing/mongoose-tracing-channel/test.ts', | ||
| 'suites/tracing/mongoose-v5/test.ts', | ||
| 'suites/tracing/mongoose-v7/test.ts', | ||
| 'suites/tracing/mongoose-v8/test.ts', | ||
| 'suites/tracing/mongoose-v9/test.ts', | ||
| 'suites/tracing/mongoose/test.ts', | ||
| 'suites/tracing/mysql/test.ts', | ||
| 'suites/tracing/mysql2-tracing-channel/test.ts', | ||
| 'suites/tracing/mysql2/test.ts', | ||
| 'suites/tracing/openai/test.ts', | ||
| 'suites/tracing/openai/v6/test.ts', | ||
| 'suites/tracing/orchestrion-lazy-registration/test.ts', | ||
| 'suites/tracing/postgres-streamed/test.ts', | ||
| 'suites/tracing/postgres/test.ts', | ||
| 'suites/tracing/postgresjs-streamed/test.ts', | ||
| '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', | ||
| 'suites/tracing/redis-cache/test.ts', | ||
| 'suites/tracing/redis-dc/test.ts', | ||
| 'suites/tracing/redis/test.ts', | ||
| 'suites/tracing/tedious/test.ts', | ||
| 'suites/tracing/together-ai/test.ts', | ||
| 'suites/tracing/vercelai/**', | ||
| ]; | ||
|
|
||
| // Fail on Bun, cause not investigated yet. `system-error` and `tracer-start-active-span-error` | ||
| // fail on Bun 1.3.14 and pass on Bun 1.4.2. With the `@sentry/bun` alias, `system-error` also | ||
| // fails because `@sentry/bun` does not include `nodeSystemErrorIntegration`. | ||
| const NOT_TRIAGED = [ | ||
| 'suites/contextLines/filename-with-spaces/test.ts', | ||
| 'suites/modules/test.ts', | ||
| 'suites/proxy/test.ts', | ||
| 'suites/system-error/test.ts', | ||
| 'suites/tracing/tracer-start-active-span-error/test.ts', | ||
| ]; | ||
|
|
||
| export const NODE_SUITES_EXCLUDE = [ | ||
| '**/node_modules/**', | ||
| ...NODE_ONLY, | ||
| ...NO_HTTP_SERVER_SPANS, | ||
| ...NO_FETCH_INSTRUMENTATION, | ||
| ...NO_OUTGOING_HTTP_INSTRUMENTATION, | ||
| ...NO_AUTO_INSTRUMENTATION, | ||
| ...NOT_TRIAGED, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so, this pulls in the full node test suite, and then
dev-packages/bun-integration-tests/node-suites/excludes.tsline 144 excludes the ones that should be excluded.But
conditionalTest(dev-packages/node-integration-tests/utils/index.tsline 52, not in this PR) builds adescribe.skipIffromNODE_VERSION, which line 6 of that file derives fromprocess.versions.node. That runs in the vitest parent, which is always Node, regardless of whatRUNTIMEspawns the scenario with.That means that when we run the bun tests, it's just using whatever version we pin the repo to, which excludes a lot of them automatically.
Suggestion: make the gate runtime-aware. Under
RUNTIME !== 'node'a Node major version is not a meaningful condition, soconditionalTestshould either skip with an explicit reason or be bypassed, and these six files should appear inexcludes.tsunder a group that says why. Right now the exclude list claims to be the complete record of what does not run on Bun, and these six are missing from it.I don't think this is a huge deal, but it would mean that the inclusion/exclusion logic is a bit hard to reason about otherwise, so it could be mysterious as to why certain bun tests aren't running.