Skip to content

Commit 0bc53a1

Browse files
committed
Fix most tests
1 parent 692fd37 commit 0bc53a1

File tree

15 files changed

+38
-60
lines changed

15 files changed

+38
-60
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"type-check": "tsc",
2323
"pretest": "yarn express-v5-install",
2424
"test": "vitest run",
25-
"test:no-prisma": "jest --config ./jest.config.js",
2625
"test:watch": "yarn test --watch"
2726
},
2827
"dependencies": {

dev-packages/node-integration-tests/suites/aws-serverless/aws-integration/s3/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const EXPECTED_TRANSCATION = {
88
description: 'S3.PutObject',
99
op: 'rpc',
1010
origin: 'auto.otel.aws',
11-
data: {
11+
data: expect.objectContaining({
1212
'sentry.origin': 'auto.otel.aws',
1313
'sentry.op': 'rpc',
1414
'rpc.system': 'aws-api',
@@ -17,7 +17,7 @@ const EXPECTED_TRANSCATION = {
1717
'aws.region': 'us-east-1',
1818
'aws.s3.bucket': 'ot-demo-test',
1919
'otel.kind': 'CLIENT',
20-
},
20+
}),
2121
}),
2222
]),
2323
};

dev-packages/node-integration-tests/suites/fs-instrumentation/test.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ test('should create spans for fs operations that take target argument', async ()
2828
})
2929
.start();
3030

31-
expect(runner.makeRequest('get', '/readFile-error')).resolves.toBe('done');
31+
const result = await runner.makeRequest('get', '/readFile-error');
32+
expect(result).toEqual('done');
3233
await runner.completed();
3334
});
3435

@@ -73,7 +74,8 @@ test('should create spans for fs operations that take one path', async () => {
7374
})
7475
.start();
7576

76-
expect(runner.makeRequest('get', '/readFile')).resolves.toBe('done');
77+
const result = await runner.makeRequest('get', '/readFile');
78+
expect(result).toEqual('done');
7779
await runner.completed();
7880
});
7981

@@ -121,7 +123,8 @@ test('should create spans for fs operations that take src and dest arguments', a
121123
})
122124
.start();
123125

124-
expect(runner.makeRequest('get', '/copyFile')).resolves.toBe('done');
126+
const result = await runner.makeRequest('get', '/copyFile');
127+
expect(result).toEqual('done');
125128
await runner.completed();
126129
});
127130

@@ -169,7 +172,8 @@ test('should create spans for fs operations that take existing path and new path
169172
})
170173
.start();
171174

172-
expect(runner.makeRequest('get', '/link')).resolves.toBe('done');
175+
const result = await runner.makeRequest('get', '/link');
176+
expect(result).toEqual('done');
173177
await runner.completed();
174178
});
175179

@@ -214,7 +218,8 @@ test('should create spans for fs operations that take prefix argument', async ()
214218
})
215219
.start();
216220

217-
expect(runner.makeRequest('get', '/mkdtemp')).resolves.toBe('done');
221+
const result = await runner.makeRequest('get', '/mkdtemp');
222+
expect(result).toEqual('done');
218223
await runner.completed();
219224
});
220225

@@ -262,6 +267,7 @@ test('should create spans for fs operations that take target argument', async ()
262267
})
263268
.start();
264269

265-
expect(runner.makeRequest('get', '/symlink')).resolves.toBe('done');
270+
const result = await runner.makeRequest('get', '/symlink');
271+
expect(result).toEqual('done');
266272
await runner.completed();
267273
});

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { TransactionEvent } from '@sentry/core';
2-
import { afterAll, describe, expect, test, vi } from 'vitest';
2+
import { afterAll, describe, expect, test } from 'vitest';
33
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
44

5-
// When running docker compose, we need a larger timeout, as this takes some time.
6-
vi.setConfig({ testTimeout: 90_000 });
7-
85
const EXPECTED_MESSAGE_SPAN_PRODUCER = expect.objectContaining({
96
op: 'message',
107
data: expect.objectContaining({
@@ -32,7 +29,7 @@ describe('amqplib auto-instrumentation', () => {
3229
cleanupChildProcesses();
3330
});
3431

35-
test('should be able to send and receive messages', async () => {
32+
test('should be able to send and receive messages', { timeout: 90_000 }, async () => {
3633
await createRunner(__dirname, 'scenario-message.ts')
3734
.withDockerCompose({
3835
workingDirectory: [__dirname],

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { afterAll, describe, expect, test, vi } from 'vitest';
22
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
33

4-
// When running docker compose, we need a larger timeout, as this takes some time...
5-
vi.setConfig({ testTimeout: 60_000 });
6-
74
describe('kafkajs', () => {
85
afterAll(() => {
96
cleanupChildProcesses();
107
});
118

12-
test('traces producers and consumers', async () => {
9+
test('traces producers and consumers', { timeout: 60_000 }, async () => {
1310
await createRunner(__dirname, 'scenario.js')
1411
.withDockerCompose({
1512
workingDirectory: [__dirname],

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { describe, expect, test, vi } from 'vitest';
22
import { createRunner } from '../../../utils/runner';
33

4-
vi.setConfig({ testTimeout: 90_000 });
5-
64
describe('knex auto instrumentation', () => {
75
// Update this if another knex version is installed
86
const KNEX_VERSION = '2.5.1';
97

10-
test('should auto-instrument `knex` package when using `pg` client', async () => {
8+
test('should auto-instrument `knex` package when using `pg` client', { timeout: 60_000 }, async () => {
119
const EXPECTED_TRANSACTION = {
1210
transaction: 'Test Transaction',
1311
spans: expect.arrayContaining([
@@ -67,7 +65,7 @@ describe('knex auto instrumentation', () => {
6765
.completed();
6866
});
6967

70-
test('should auto-instrument `knex` package when using `mysql2` client', async () => {
68+
test('should auto-instrument `knex` package when using `mysql2` client', { timeout: 60_000 }, async () => {
7169
const EXPECTED_TRANSACTION = {
7270
transaction: 'Test Transaction',
7371
spans: expect.arrayContaining([

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { afterAll, describe, expect, test, vi } from 'vitest';
22
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
33

4-
// When running docker compose, we need a larger timeout, as this takes some time...
5-
vi.setConfig({ testTimeout: 75_000 });
6-
74
describe('mysql2 auto instrumentation', () => {
85
afterAll(() => {
96
cleanupChildProcesses();
107
});
118

12-
test('should auto-instrument `mysql` package without connection.connect()', async () => {
9+
test('should auto-instrument `mysql` package without connection.connect()', { timeout: 75_000 }, async () => {
1310
const EXPECTED_TRANSACTION = {
1411
transaction: 'Test Transaction',
1512
spans: expect.arrayContaining([

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { describe, expect, test, vi } from 'vitest';
1+
import { describe, expect, test } from 'vitest';
22
import { createRunner } from '../../../utils/runner';
33

4-
// When running docker compose, we need a larger timeout, as this takes some time...
5-
vi.setConfig({ testTimeout: 575 });
6-
74
describe('postgres auto instrumentation', () => {
8-
test('should auto-instrument `pg` package', async () => {
5+
test('should auto-instrument `pg` package', { timeout: 60_000 }, async () => {
96
const EXPECTED_TRANSACTION = {
107
transaction: 'Test Transaction',
118
spans: expect.arrayContaining([

dev-packages/node-integration-tests/suites/tracing/prisma-orm-v5/test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { afterAll, describe, expect, test, vi } from 'vitest';
1+
import { afterAll, describe, expect, test } from 'vitest';
22
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
33

4-
// When running docker compose, we need a larger timeout, as this takes some time...
5-
vi.setConfig({ testTimeout: 75_000 });
6-
74
afterAll(() => {
85
cleanupChildProcesses();
96
});
107

118
describe('Prisma ORM v5 Tests', () => {
12-
test('CJS - should instrument PostgreSQL queries from Prisma ORM', async () => {
9+
test('CJS - should instrument PostgreSQL queries from Prisma ORM', { timeout: 75_000 }, async () => {
1310
await createRunner(__dirname, 'scenario.js')
1411
.withDockerCompose({
1512
workingDirectory: [__dirname],

dev-packages/node-integration-tests/suites/tracing/prisma-orm-v6/test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import type { SpanJSON } from '@sentry/core';
22
import { afterAll, describe, expect, test, vi } from 'vitest';
33
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
44

5-
// When running docker compose, we need a larger timeout, as this takes some time...
6-
vi.setConfig({ testTimeout: 75_000 });
7-
85
afterAll(() => {
96
cleanupChildProcesses();
107
});
118

129
describe('Prisma ORM v6 Tests', () => {
13-
test('CJS - should instrument PostgreSQL queries from Prisma ORM', async () => {
10+
test('CJS - should instrument PostgreSQL queries from Prisma ORM', { timeout: 75_000 }, async () => {
1411
await createRunner(__dirname, 'scenario.js')
1512
.withDockerCompose({
1613
workingDirectory: [__dirname],

0 commit comments

Comments
 (0)