Skip to content

Commit faf4ecb

Browse files
committed
Merge branch 'develop' into nh/ref-remove-is-orchestrion-enabled
# Conflicts: # dev-packages/node-integration-tests/suites/tracing/mongodb-v7/test.ts # dev-packages/node-integration-tests/suites/tracing/mongoose-tracing-channel/test.ts # dev-packages/node-integration-tests/suites/tracing/mongoose-v9/test.ts
2 parents 584b3b5 + 78d75c1 commit faf4ecb

46 files changed

Lines changed: 629 additions & 345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎dev-packages/cloudflare-integration-tests/suites/types/withsentry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface ManualEnv {
2323
export const reproduction = withSentry(
2424
env => {
2525
expectTypeOf(env).toEqualTypeOf<ManualEnv>();
26-
return { dsn: env.SENTRY_DATA_SOURCE_NAME, sendDefaultPii: true };
26+
return { dsn: env.SENTRY_DATA_SOURCE_NAME };
2727
},
2828
{
2929
fetch(_, env) {

‎dev-packages/node-integration-tests/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"fastify": "^5.7.0",
6969
"generic-pool": "^3.9.0",
7070
"graphql": "^16.11.0",
71-
"graphql-tag": "^2.12.6",
71+
"graphql-tag": "^2.12.7",
7272
"hono": "^4.12.34",
7373
"http-terminator": "^3.2.0",
7474
"ioredis": "5.10.1",

‎dev-packages/node-integration-tests/suites/breadcrumbs/process-thread/test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Event } from '@sentry/core';
2-
import { afterAll, expect, test } from 'vitest';
3-
import { conditionalTest } from '../../../utils';
2+
import { afterAll, describe, expect, test } from 'vitest';
43
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
54

65
const EVENT = {
@@ -35,7 +34,7 @@ const EVENT = {
3534
],
3635
};
3736

38-
conditionalTest({ min: 20 })('should capture process and thread breadcrumbs', () => {
37+
describe('should capture process and thread breadcrumbs', () => {
3938
afterAll(() => {
4039
cleanupChildProcesses();
4140
});

‎dev-packages/node-integration-tests/suites/child-process/test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Event } from '@sentry/core';
22
import { afterAll, describe, expect, test } from 'vitest';
3-
import { conditionalTest } from '../../utils';
43
import { cleanupChildProcesses, createRunner } from '../../utils/runner';
54

65
const WORKER_EVENT: Event = {
@@ -44,7 +43,7 @@ describe('should capture child process events', () => {
4443
cleanupChildProcesses();
4544
});
4645

47-
conditionalTest({ min: 20 })('worker', () => {
46+
describe('worker', () => {
4847
test('ESM', async () => {
4948
await createRunner(__dirname, 'worker.mjs').expect({ event: WORKER_EVENT }).start().completed();
5049
});
@@ -54,7 +53,7 @@ describe('should capture child process events', () => {
5453
});
5554
});
5655

57-
conditionalTest({ min: 20 })('fork', () => {
56+
describe('fork', () => {
5857
test('ESM', async () => {
5958
await createRunner(__dirname, 'fork.mjs').expect({ event: CHILD_EVENT }).start().completed();
6059
});

‎dev-packages/node-integration-tests/suites/esm/warn-esm/test.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,7 @@ afterAll(() => {
77

88
const esmWarning = `[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`;
99

10-
test("warns if using ESM on Node.js versions that don't support `register()`", async () => {
11-
const nodeMajorVersion = Number(process.versions.node.split('.')[0]);
12-
if (nodeMajorVersion >= 18) {
13-
return;
14-
}
15-
16-
const runner = createRunner(__dirname, 'server.mjs').ignore('event').start();
17-
18-
await runner.makeRequest('get', '/test/success');
19-
20-
expect(runner.getLogs()).toContain(esmWarning);
21-
});
22-
2310
test('does not warn if using ESM on Node.js versions that support `register()`', async () => {
24-
const nodeMajorVersion = Number(process.versions.node.split('.')[0]);
25-
if (nodeMajorVersion < 18) {
26-
return;
27-
}
28-
2911
const runner = createRunner(__dirname, 'server.mjs').ignore('event').start();
3012

3113
await runner.makeRequest('get', '/test/success');

‎dev-packages/node-integration-tests/suites/pino/test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { afterAll, expect } from 'vitest';
2-
import { conditionalTest } from '../../utils';
1+
import { afterAll, describe, expect } from 'vitest';
32
import { cleanupChildProcesses, createEsmTests } from '../../utils/runner';
43

5-
conditionalTest({ min: 20 })('Pino integration', () => {
4+
describe('Pino integration', () => {
65
afterAll(() => {
76
cleanupChildProcesses();
87
});

‎dev-packages/node-integration-tests/suites/public-api/LocalVariables/test.ts‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { mkdirSync, rmdirSync, unlinkSync, writeFileSync } from 'fs';
22
import * as path from 'path';
33
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
4-
import { conditionalTest } from '../../../utils';
54
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
65

76
// This test takes some time because it connects the debugger etc.
@@ -108,19 +107,15 @@ module.exports = { out_of_app_function };`,
108107
.completed();
109108
});
110109

111-
conditionalTest({ min: 19 })('Node v19+', () => {
112-
test('Should not import inspector when not in use', async () => {
113-
await createRunner(__dirname, 'deny-inspector.mjs').ensureNoErrorOutput().start().completed();
114-
});
110+
test('Should not import inspector when not in use', async () => {
111+
await createRunner(__dirname, 'deny-inspector.mjs').ensureNoErrorOutput().start().completed();
115112
});
116113

117-
conditionalTest({ min: 20 })('Node v20+', () => {
118-
test('Should retain original local variables when error is re-thrown', async () => {
119-
await createRunner(__dirname, 'local-variables-rethrow.js')
120-
.expect({ event: EXPECTED_LOCAL_VARIABLES_EVENT })
121-
.start()
122-
.completed();
123-
});
114+
test('Should retain original local variables when error is re-thrown', async () => {
115+
await createRunner(__dirname, 'local-variables-rethrow.js')
116+
.expect({ event: EXPECTED_LOCAL_VARIABLES_EVENT })
117+
.start()
118+
.completed();
124119
});
125120

126121
test('Includes local variables for caught exceptions when enabled', async () => {

‎dev-packages/node-integration-tests/suites/public-api/OnUncaughtException/test.ts‎

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as childProcess from 'child_process';
22
import * as path from 'path';
33
import { describe, expect, test } from 'vitest';
4-
import { conditionalTest } from '../../../utils';
54
import { createRunner } from '../../../utils/runner';
65

76
describe('OnUncaughtException integration', () => {
@@ -103,37 +102,7 @@ describe('OnUncaughtException integration', () => {
103102
.completed();
104103
});
105104

106-
conditionalTest({ max: 18 })('Worker thread error handling Node 18', () => {
107-
test('should capture uncaught worker thread errors - without childProcess integration', async () => {
108-
await createRunner(__dirname, 'worker-thread/uncaught-worker.mjs')
109-
.withInstrument(path.join(__dirname, 'worker-thread/instrument.mjs'))
110-
.expect({
111-
event: {
112-
level: 'fatal',
113-
exception: {
114-
values: [
115-
{
116-
type: 'Error',
117-
value: 'job failed',
118-
mechanism: {
119-
type: 'auto.node.onuncaughtexception',
120-
handled: false,
121-
},
122-
stacktrace: {
123-
frames: expect.any(Array),
124-
},
125-
},
126-
],
127-
},
128-
},
129-
})
130-
.start()
131-
.completed();
132-
});
133-
});
134-
135-
// childProcessIntegration only exists in Node 20+
136-
conditionalTest({ min: 20 })('Worker thread error handling Node 20+', () => {
105+
describe('Worker thread error handling', () => {
137106
test.each(['mjs', 'js'])('should not interfere with worker thread error handling ".%s"', async extension => {
138107
const runner = createRunner(__dirname, `worker-thread/caught-worker.${extension}`)
139108
.withFlags('--import', path.join(__dirname, `worker-thread/instrument.${extension}`))

‎dev-packages/node-integration-tests/suites/tracing/fastify/test.ts‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { afterAll, describe, expect } from 'vitest';
2-
import { conditionalTest } from '../../../utils';
32
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner';
43

54
describe('fastify auto-instrumentation', () => {
65
afterAll(() => {
76
cleanupChildProcesses();
87
});
98

10-
// Fastify v5 does not support Node 18
11-
conditionalTest({ min: 20 })('fastify v5', () => {
9+
describe('fastify v5', () => {
1210
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
1311
test('creates transaction with fastify hook, request-handler and manual spans', async () => {
1412
const runner = createRunner()
@@ -50,10 +48,9 @@ describe('fastify auto-instrumentation', () => {
5048
});
5149

5250
// Fastify v5 only publishes the `tracing:fastify.request.handler:error` diagnostics channel when
53-
// `tracingChannel(...).hasSubscribers` is truthy. That aggregate getter does not exist on Node 18
54-
// (it was added in Node 20), so fastify takes the fast path and never publishes the channel there —
55-
// making automatic error capture (without `setupFastifyErrorHandler`) impossible on Node 18.
56-
conditionalTest({ min: 20 })('error capture via diagnostics channel', () => {
51+
// `tracingChannel(...).hasSubscribers` is truthy, which is what enables automatic error capture
52+
// without `setupFastifyErrorHandler`.
53+
describe('error capture via diagnostics channel', () => {
5754
test('captures errors thrown in route handlers', async () => {
5855
const runner = createRunner()
5956
.ignore('transaction')

‎dev-packages/node-integration-tests/suites/tracing/httpIntegration/instrument-options.mjs‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,6 @@ Sentry.init({
1919
resMethod: res.req.method,
2020
});
2121
},
22-
instrumentation: {
23-
requestHook: (span, req) => {
24-
span.setAttribute('attr1', 'yes');
25-
Sentry.setExtra('requestHookCalled', {
26-
url: req.url,
27-
method: req.method,
28-
});
29-
},
30-
responseHook: (span, res) => {
31-
span.setAttribute('attr2', 'yes');
32-
Sentry.setExtra('responseHookCalled', {
33-
url: res.req.url,
34-
method: res.req.method,
35-
});
36-
},
37-
applyCustomAttributesOnSpan: (span, req, res) => {
38-
span.setAttribute('attr3', 'yes');
39-
Sentry.setExtra('applyCustomAttributesOnSpanCalled', {
40-
reqUrl: req.url,
41-
reqMethod: req.method,
42-
resUrl: res.req.url,
43-
resMethod: res.req.method,
44-
});
45-
},
46-
},
4722
}),
4823
],
4924
});

0 commit comments

Comments
 (0)