From 278df2aed99c2b84ad545bd2aa47ccfa61436ee8 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Wed, 23 Sep 2026 17:47:32 +0200 Subject: [PATCH 1/2] test(bun): Run all Node integration suites on Bun 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 --- .../node-suites/excludes.ts | 151 ++++++++++++++++++ .../bun-integration-tests/vite.config.mts | 14 +- .../suites/bun-runtime-metrics/test.ts | 6 +- .../suites/consola/test.ts | 51 +++--- .../suites/winston/test.ts | 41 ++--- .../utils/assertions.ts | 5 +- 6 files changed, 210 insertions(+), 58 deletions(-) create mode 100644 dev-packages/bun-integration-tests/node-suites/excludes.ts diff --git a/dev-packages/bun-integration-tests/node-suites/excludes.ts b/dev-packages/bun-integration-tests/node-suites/excludes.ts new file mode 100644 index 000000000000..49d7d6f4b28d --- /dev/null +++ b/dev-packages/bun-integration-tests/node-suites/excludes.ts @@ -0,0 +1,151 @@ +// 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', +]; + +// JS-3507: Bun 1.3.14 (the CI version) does not instrument outgoing `node:http` requests. These +// suites pass on Bun 1.4.2. +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/**', +]; + +// JS-3508: `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`. +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, +]; diff --git a/dev-packages/bun-integration-tests/vite.config.mts b/dev-packages/bun-integration-tests/vite.config.mts index 2c64f0c8453b..7e64518e836d 100644 --- a/dev-packages/bun-integration-tests/vite.config.mts +++ b/dev-packages/bun-integration-tests/vite.config.mts @@ -1,18 +1,12 @@ import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vitest/config'; import baseConfig from '../../vite/vite.config'; +import { NODE_SUITES_EXCLUDE } from './node-suites/excludes'; const NODE_SUITES_ROOT = fileURLToPath(new URL('../node-integration-tests', import.meta.url)); -// Node suites that also run on Bun. The scenarios stay in `node-integration-tests`. -const NODE_SUITES = [ - 'suites/public-api/**/test.ts', - 'suites/client-reports/**/test.ts', - 'suites/featureFlags/**/test.ts', -]; - -// Single tests that fail on Bun are skipped with `test.skipIf` on `RUNTIME` in the Node suite. -const NODE_SUITES_EXCLUDE = ['**/node_modules/**']; +// All Node suites also run on Bun. The scenarios stay in `node-integration-tests`. +const NODE_SUITES = ['suites/**/test.ts']; const nodeSuitesTest = { root: NODE_SUITES_ROOT, @@ -73,6 +67,8 @@ export default defineConfig({ ...NODE_SUITES_EXCLUDE, // The scenario creates a `NodeClient` itself, which sends `sentry.javascript.node`. 'suites/public-api/logs/test.ts', + // `@sentry/bun` has `bunRuntimeMetricsIntegration` instead of `nodeRuntimeMetricsIntegration`. + 'suites/node-runtime-metrics/test.ts', ], env: { RUNTIME: 'bun', diff --git a/dev-packages/node-integration-tests/suites/bun-runtime-metrics/test.ts b/dev-packages/node-integration-tests/suites/bun-runtime-metrics/test.ts index 78638b8b02cb..e5a0fa7df356 100644 --- a/dev-packages/node-integration-tests/suites/bun-runtime-metrics/test.ts +++ b/dev-packages/node-integration-tests/suites/bun-runtime-metrics/test.ts @@ -1,10 +1,11 @@ import { afterAll, describe, expect, test } from 'vitest'; import { cleanupChildProcesses, createRunner } from '../../utils/runner'; +import { EXPECTED_SDK_NAME, RUNTIME } from '../../utils'; const SENTRY_ATTRIBUTES = { 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'sentry.origin': { value: 'auto.bun.runtime_metrics', type: 'string' }, }; @@ -29,7 +30,8 @@ const counter = (name: string, unit?: string) => ({ attributes: expect.objectContaining(SENTRY_ATTRIBUTES), }); -describe('bunRuntimeMetricsIntegration', () => { +// The integration measures the Bun process, so the suite runs on Bun only. +describe.skipIf(RUNTIME !== 'bun')('bunRuntimeMetricsIntegration', () => { afterAll(() => { cleanupChildProcesses(); }); diff --git a/dev-packages/node-integration-tests/suites/consola/test.ts b/dev-packages/node-integration-tests/suites/consola/test.ts index aee250967e64..1afcd97cb025 100644 --- a/dev-packages/node-integration-tests/suites/consola/test.ts +++ b/dev-packages/node-integration-tests/suites/consola/test.ts @@ -1,5 +1,6 @@ import { afterAll, describe, expect } from 'vitest'; import { cleanupChildProcesses, createCjsTests } from '../../utils/runner'; +import { EXPECTED_SDK_NAME } from '../../utils'; describe('consola integration', () => { afterAll(() => { @@ -22,7 +23,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'info', type: 'string' }, @@ -39,7 +40,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'error', type: 'string' }, @@ -56,7 +57,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'warn', type: 'string' }, @@ -89,7 +90,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'info', type: 'string' }, @@ -106,7 +107,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'error', type: 'string' }, @@ -123,7 +124,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'warn', type: 'string' }, @@ -141,7 +142,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'success', type: 'string' }, @@ -158,7 +159,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'fail', type: 'string' }, @@ -175,7 +176,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'ready', type: 'string' }, @@ -192,7 +193,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'start', type: 'string' }, @@ -209,7 +210,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'box', type: 'string' }, @@ -226,7 +227,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'verbose', type: 'string' }, @@ -242,7 +243,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'debug', type: 'string' }, @@ -259,7 +260,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'trace', type: 'string' }, @@ -291,7 +292,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'info', type: 'string' }, @@ -308,7 +309,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'debug', type: 'string' }, @@ -352,7 +353,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.tag': { value: 'api', type: 'string' }, @@ -370,7 +371,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.tag': { value: 'api', type: 'string' }, @@ -404,7 +405,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'warn', type: 'string' }, @@ -422,7 +423,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'error', type: 'string' }, @@ -454,7 +455,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'fatal', type: 'string' }, @@ -471,7 +472,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'warn', type: 'string' }, @@ -488,7 +489,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'info', type: 'string' }, @@ -520,7 +521,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'info', type: 'string' }, @@ -539,7 +540,7 @@ describe('consola integration', () => { 'sentry.origin': { value: 'auto.log.consola', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, 'consola.type': { value: 'info', type: 'string' }, diff --git a/dev-packages/node-integration-tests/suites/winston/test.ts b/dev-packages/node-integration-tests/suites/winston/test.ts index 2555a4eddb03..b36e128497de 100644 --- a/dev-packages/node-integration-tests/suites/winston/test.ts +++ b/dev-packages/node-integration-tests/suites/winston/test.ts @@ -1,5 +1,6 @@ import { afterAll, describe, expect } from 'vitest'; import { cleanupChildProcesses, createCjsTests } from '../../utils/runner'; +import { EXPECTED_SDK_NAME } from '../../utils'; describe('winston integration', () => { afterAll(() => { @@ -22,7 +23,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -37,7 +38,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -66,7 +67,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -81,7 +82,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -96,7 +97,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -111,7 +112,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -140,7 +141,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -155,7 +156,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -170,7 +171,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -205,7 +206,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -220,7 +221,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -235,7 +236,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, foo: { value: 'bar', type: 'string' }, @@ -267,7 +268,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -282,7 +283,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -298,7 +299,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -334,7 +335,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -349,7 +350,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -365,7 +366,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -380,7 +381,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, @@ -395,7 +396,7 @@ describe('winston integration', () => { 'sentry.origin': { value: 'auto.log.winston', type: 'string' }, 'sentry.release': { value: '1.0.0', type: 'string' }, 'sentry.environment': { value: 'test', type: 'string' }, - 'sentry.sdk.name': { value: 'sentry.javascript.node', type: 'string' }, + 'sentry.sdk.name': { value: EXPECTED_SDK_NAME, type: 'string' }, 'sentry.sdk.version': { value: expect.any(String), type: 'string' }, 'server.address': { value: expect.any(String), type: 'string' }, }, diff --git a/dev-packages/node-integration-tests/utils/assertions.ts b/dev-packages/node-integration-tests/utils/assertions.ts index b6c45ebc043c..cf1c289e05a6 100644 --- a/dev-packages/node-integration-tests/utils/assertions.ts +++ b/dev-packages/node-integration-tests/utils/assertions.ts @@ -12,6 +12,7 @@ import type { } from '@sentry/core'; import { SDK_VERSION } from '@sentry/core'; import { expect } from 'vitest'; +import { EXPECTED_SDK_NAME } from './index'; export type DeepPartial = T extends object ? { @@ -108,7 +109,7 @@ export function assertEnvelopeHeader(actual: Envelope[0], expected: Partial Date: Wed, 23 Sep 2026 18:38:59 +0200 Subject: [PATCH 2/2] fixup! test(bun): Run all Node integration suites on Bun Co-Authored-By: Claude Opus 5.5 --- .../bun-integration-tests/node-suites/excludes.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev-packages/bun-integration-tests/node-suites/excludes.ts b/dev-packages/bun-integration-tests/node-suites/excludes.ts index 49d7d6f4b28d..6d9ce5d37011 100644 --- a/dev-packages/bun-integration-tests/node-suites/excludes.ts +++ b/dev-packages/bun-integration-tests/node-suites/excludes.ts @@ -51,8 +51,8 @@ const NO_FETCH_INSTRUMENTATION = [ 'suites/tracing/requests/traceparent/test.ts', ]; -// JS-3507: Bun 1.3.14 (the CI version) does not instrument outgoing `node:http` requests. These -// suites pass on Bun 1.4.2. +// 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', @@ -68,8 +68,9 @@ const NO_OUTGOING_HTTP_INSTRUMENTATION = [ 'suites/tracing/tracePropagationTargets/**', ]; -// JS-3508: `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`. +// `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',