diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index daaf5effc2a0..4f19d81a92e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -554,7 +554,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18, 20, 22, 24] + node: [18, 20, 22, 24, 26] steps: - name: Check out base commit (${{ github.event.pull_request.base.sha }}) uses: actions/checkout@v6 @@ -810,7 +810,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18, 20, 22, 24] + node: [18, 20, 22, 24, 26] typescript: - false include: @@ -851,7 +851,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18, 20, 22, 24] + node: [18, 20, 22, 24, 26] typescript: - false include: @@ -939,7 +939,7 @@ jobs: strategy: fail-fast: false matrix: - node: [18, 20, 22, 24] + node: [18, 20, 22, 24, 26] steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) uses: actions/checkout@v6 diff --git a/dev-packages/node-core-integration-tests/utils/runner.ts b/dev-packages/node-core-integration-tests/utils/runner.ts index d27c65fc81be..69163754c89e 100644 --- a/dev-packages/node-core-integration-tests/utils/runner.ts +++ b/dev-packages/node-core-integration-tests/utils/runner.ts @@ -486,7 +486,8 @@ export function createRunner(...paths: string[]) { if (process.env.DEBUG) log('stderr line', output); - if (ensureNoErrorOutput) { + // Ignore deprecation warnings for this purpose + if (ensureNoErrorOutput && !`${output}`.includes('DeprecationWarning:')) { complete(new Error(`Expected no error output but got: '${output}'`)); } }); diff --git a/dev-packages/node-integration-tests/suites/integrations/console/filter/test.ts b/dev-packages/node-integration-tests/suites/integrations/console/filter/test.ts index 5f0bf9e8b14a..decbe91dbb00 100644 --- a/dev-packages/node-integration-tests/suites/integrations/console/filter/test.ts +++ b/dev-packages/node-integration-tests/suites/integrations/console/filter/test.ts @@ -8,7 +8,7 @@ describe('Console Integration', () => { createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => { test('filters console messages', async () => { - await createRunner() + const runner = createRunner() .expect({ event: { exception: { @@ -28,8 +28,17 @@ describe('Console Integration', () => { ], }, }) - .start() - .completed(); + .start(); + + await runner.completed(); + + expect(runner.getLogs()).toContainEqual('hello'); + expect(runner.getLogs()).toContainEqual('baz'); + expect(runner.getLogs()).not.toContainEqual('foo'); + expect(runner.getLogs()).not.toContainEqual('foo2'); + + // Ensure deprecation warnigns are not included + expect(runner.getLogs()).not.toContainEqual(expect.stringMatching('DeprecationWarning')); }); }); }); diff --git a/dev-packages/node-integration-tests/suites/tracing/postgres/package.json b/dev-packages/node-integration-tests/suites/tracing/postgres/package.json index 602eab3a6f3d..040e636bcb69 100644 --- a/dev-packages/node-integration-tests/suites/tracing/postgres/package.json +++ b/dev-packages/node-integration-tests/suites/tracing/postgres/package.json @@ -10,7 +10,7 @@ "author": "", "license": "ISC", "dependencies": { - "pg": "8.16.0", - "pg-native": "3.5.0" + "pg": "8.20.0", + "pg-native": "3.7.0" } } diff --git a/dev-packages/node-integration-tests/suites/tracing/postgres/test.ts b/dev-packages/node-integration-tests/suites/tracing/postgres/test.ts index 98c42976498a..e5d0e3f26fa8 100644 --- a/dev-packages/node-integration-tests/suites/tracing/postgres/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/postgres/test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from 'vitest'; import { createRunner } from '../../../utils/runner'; +import { conditionalTest } from '../../../utils'; describe('postgres auto instrumentation', () => { test('should auto-instrument `pg` package', { timeout: 90_000 }, async () => { @@ -49,7 +50,6 @@ describe('postgres auto instrumentation', () => { await createRunner(__dirname, 'scenario.js') .withDockerCompose({ workingDirectory: [__dirname], - setupCommand: 'yarn', }) .expect({ transaction: EXPECTED_TRANSACTION }) .start() @@ -60,7 +60,6 @@ describe('postgres auto instrumentation', () => { await createRunner(__dirname, 'scenario-ignoreConnect.js') .withDockerCompose({ workingDirectory: [__dirname], - setupCommand: 'yarn', }) .expect({ transaction: txn => { @@ -103,57 +102,59 @@ describe('postgres auto instrumentation', () => { .completed(); }); - test('should auto-instrument `pg-native` package', { timeout: 90_000 }, async () => { - const EXPECTED_TRANSACTION = { - transaction: 'Test Transaction', - spans: expect.arrayContaining([ - expect.objectContaining({ - data: expect.objectContaining({ - 'db.system': 'postgresql', - 'db.name': 'tests', - 'sentry.origin': 'manual', - 'sentry.op': 'db', + conditionalTest({ max: 25 })('pg-native', () => { + test('should auto-instrument `pg-native` package', { timeout: 90_000 }, async () => { + const EXPECTED_TRANSACTION = { + transaction: 'Test Transaction', + spans: expect.arrayContaining([ + expect.objectContaining({ + data: expect.objectContaining({ + 'db.system': 'postgresql', + 'db.name': 'tests', + 'sentry.origin': 'manual', + 'sentry.op': 'db', + }), + description: 'pg.connect', + op: 'db', + status: 'ok', }), - description: 'pg.connect', - op: 'db', - status: 'ok', - }), - expect.objectContaining({ - data: expect.objectContaining({ - 'db.system': 'postgresql', - 'db.name': 'tests', - 'db.statement': 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)', - 'sentry.origin': 'auto.db.otel.postgres', - 'sentry.op': 'db', + expect.objectContaining({ + data: expect.objectContaining({ + 'db.system': 'postgresql', + 'db.name': 'tests', + 'db.statement': 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)', + 'sentry.origin': 'auto.db.otel.postgres', + 'sentry.op': 'db', + }), + description: 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)', + op: 'db', + status: 'ok', + origin: 'auto.db.otel.postgres', }), - description: 'INSERT INTO "NativeUser" ("email", "name") VALUES ($1, $2)', - op: 'db', - status: 'ok', - origin: 'auto.db.otel.postgres', - }), - expect.objectContaining({ - data: expect.objectContaining({ - 'db.system': 'postgresql', - 'db.name': 'tests', - 'db.statement': 'SELECT * FROM "NativeUser"', - 'sentry.origin': 'auto.db.otel.postgres', - 'sentry.op': 'db', + expect.objectContaining({ + data: expect.objectContaining({ + 'db.system': 'postgresql', + 'db.name': 'tests', + 'db.statement': 'SELECT * FROM "NativeUser"', + 'sentry.origin': 'auto.db.otel.postgres', + 'sentry.op': 'db', + }), + description: 'SELECT * FROM "NativeUser"', + op: 'db', + status: 'ok', + origin: 'auto.db.otel.postgres', }), - description: 'SELECT * FROM "NativeUser"', - op: 'db', - status: 'ok', - origin: 'auto.db.otel.postgres', - }), - ]), - }; + ]), + }; - await createRunner(__dirname, 'scenario-native.js') - .withDockerCompose({ - workingDirectory: [__dirname], - setupCommand: 'yarn', - }) - .expect({ transaction: EXPECTED_TRANSACTION }) - .start() - .completed(); + await createRunner(__dirname, 'scenario-native.js') + .withDockerCompose({ + workingDirectory: [__dirname], + setupCommand: 'yarn', + }) + .expect({ transaction: EXPECTED_TRANSACTION }) + .start() + .completed(); + }); }); }); diff --git a/dev-packages/node-integration-tests/suites/tracing/postgres/yarn.lock b/dev-packages/node-integration-tests/suites/tracing/postgres/yarn.lock index 9eb59e69f6c2..8b2e296ece0b 100644 --- a/dev-packages/node-integration-tests/suites/tracing/postgres/yarn.lock +++ b/dev-packages/node-integration-tests/suites/tracing/postgres/yarn.lock @@ -27,38 +27,38 @@ nan@~2.22.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.2.tgz#6b504fd029fb8f38c0990e52ad5c26772fdacfbb" integrity sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ== -pg-cloudflare@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.2.5.tgz#2e3649c38a7a9c74a7e5327c8098a2fd9af595bd" - integrity sha512-OOX22Vt0vOSRrdoUPKJ8Wi2OpE/o/h9T8X1s4qSkCedbNah9ei2W2765be8iMVxQUsvgT7zIAT2eIa9fs5+vtg== +pg-cloudflare@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.3.0.tgz#386035d4bfcf1a7045b026f8b21acf5353f14d65" + integrity sha512-6lswVVSztmHiRtD6I8hw4qP/nDm1EJbKMRhf3HCYaqud7frGysPv7FYJ5noZQdhQtN2xJnimfMtvQq21pdbzyQ== -pg-connection-string@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.9.0.tgz#f75e06591fdd42ec7636fe2c6a03febeedbec9bf" - integrity sha512-P2DEBKuvh5RClafLngkAuGe9OUlFV7ebu8w1kmaaOgPcpJd1RIFh7otETfI6hAR8YupOLFTY7nuvvIn7PLciUQ== +pg-connection-string@^2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.12.0.tgz#4084f917902bb2daae3dc1376fe24ac7b4eaccf2" + integrity sha512-U7qg+bpswf3Cs5xLzRqbXbQl85ng0mfSV/J0nnA31MCLgvEaAo7CIhmeyrmJpOr7o+zm0rXK+hNnT5l9RHkCkQ== pg-int8@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== -pg-native@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/pg-native/-/pg-native-3.5.0.tgz#1a43c0d5f5744e40df3bf737c43178ce98984255" - integrity sha512-rj4LYouevTdKxvRLnvtOLEPOerkiPAqUdZE1K48IfQluEH/x7GrldEDdSaEOmJ6z7s6LQwDTpAPhm2s00iG8xw== +pg-native@3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/pg-native/-/pg-native-3.7.0.tgz#1bd78031482c78dc5240c4350cddb291493dc34f" + integrity sha512-q2V5DynvPt4PD75q1DqZOUrieEgE4bf/flEeLCzzs8axgn8x2mRCUhd1DP0cqMz8FEdpVEDb0/zKblQWeijbGg== dependencies: libpq "^1.8.15" pg-types "2.2.0" -pg-pool@^3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.10.0.tgz#134b0213755c5e7135152976488aa7cd7ee1268d" - integrity sha512-DzZ26On4sQ0KmqnO34muPcmKbhrjmyiO4lCCR0VwEd7MjmiKf5NTg/6+apUEu0NF7ESa37CGzFxH513CoUmWnA== +pg-pool@^3.13.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.13.0.tgz#416482e9700e8f80c685a6ae5681697a413c13a3" + integrity sha512-gB+R+Xud1gLFuRD/QgOIgGOBE2KCQPaPwkzBBGC9oG69pHTkhQeIuejVIk3/cnDyX39av2AxomQiyPT13WKHQA== -pg-protocol@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.10.0.tgz#a473afcbb1c6e5dc3ac24869ba3dd563f8a1ae1b" - integrity sha512-IpdytjudNuLv8nhlHs/UrVBhU0e78J0oIS/0AVdTbWxSOkFUVdsHC/NrorO6nXsQNDTT1kzDSOMJubBQviX18Q== +pg-protocol@^1.13.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.13.0.tgz#fdaf6d020bca590d58bb991b4b16fc448efe0511" + integrity sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w== pg-types@2.2.0: version "2.2.0" @@ -71,18 +71,18 @@ pg-types@2.2.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" -pg@8.16.0: - version "8.16.0" - resolved "https://registry.yarnpkg.com/pg/-/pg-8.16.0.tgz#40b08eedb5eb1834252cf3e3629503e32e6c6c04" - integrity sha512-7SKfdvP8CTNXjMUzfcVTaI+TDzBEeaUnVwiVGZQD1Hh33Kpev7liQba9uLd4CfN8r9mCVsD0JIpq03+Unpz+kg== +pg@8.20.0: + version "8.20.0" + resolved "https://registry.yarnpkg.com/pg/-/pg-8.20.0.tgz#1a274de944cb329fd6dd77a6d371a005ba6b136d" + integrity sha512-ldhMxz2r8fl/6QkXnBD3CR9/xg694oT6DZQ2s6c/RI28OjtSOpxnPrUCGOBJ46RCUxcWdx3p6kw/xnDHjKvaRA== dependencies: - pg-connection-string "^2.9.0" - pg-pool "^3.10.0" - pg-protocol "^1.10.0" + pg-connection-string "^2.12.0" + pg-pool "^3.13.0" + pg-protocol "^1.13.0" pg-types "2.2.0" pgpass "1.0.5" optionalDependencies: - pg-cloudflare "^1.2.5" + pg-cloudflare "^1.3.0" pgpass@1.0.5: version "1.0.5" diff --git a/dev-packages/node-integration-tests/utils/runner.ts b/dev-packages/node-integration-tests/utils/runner.ts index 89f96974c123..0aebd074008d 100644 --- a/dev-packages/node-integration-tests/utils/runner.ts +++ b/dev-packages/node-integration-tests/utils/runner.ts @@ -602,7 +602,8 @@ export function createRunner(...paths: string[]) { if (process.env.DEBUG) log('stderr line', output); - if (ensureNoErrorOutput) { + // Ignore deprecation warnings for this purpose + if (ensureNoErrorOutput && !`${output}`.includes('DeprecationWarning:')) { complete(new Error(`Expected no error output but got: '${output}'`)); } }); diff --git a/packages/node-core/src/integrations/console.ts b/packages/node-core/src/integrations/console.ts index d85e00e6b9d7..86591871999e 100644 --- a/packages/node-core/src/integrations/console.ts +++ b/packages/node-core/src/integrations/console.ts @@ -39,7 +39,14 @@ export const consoleIntegration = defineIntegration((options: Partial => { - if (![16, 18, 20, 22, 24].includes(NODE_MAJOR)) { + if (![16, 18, 20, 22, 24, 26].includes(NODE_MAJOR)) { consoleSandbox(() => { // eslint-disable-next-line no-console console.warn( diff --git a/yarn.lock b/yarn.lock index d5e66586670c..78e5b0b5d356 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7694,10 +7694,10 @@ detect-libc "^2.0.3" node-abi "^3.73.0" -"@sentry-internal/node-native-stacktrace@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/node-native-stacktrace/-/node-native-stacktrace-0.4.0.tgz#8f6e7a21537373a5623714c14d3350e1bb4602f0" - integrity sha512-cuRBBqnsHOJJqLCii9GvwedzjetsihIarq7TxCjgG88JyF8TZWRMlUBu/OogWhYZVU8uHqAeSvpbzolnmdhdkw== +"@sentry-internal/node-native-stacktrace@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/node-native-stacktrace/-/node-native-stacktrace-0.5.0.tgz#834a5326fd45a97d1abe3b6110e9b268c7a2fa4e" + integrity sha512-vi+yY8D0TgUdpd8ja2BPqm689N+WZPWfXNkx0fzKYlVRGymUpQeyUrz2b6dscYE8Qr3ZiA6sz8RtXeQy1r9ZTQ== dependencies: detect-libc "^2.0.4" node-abi "^3.89.0"