-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
50 lines (47 loc) · 1.59 KB
/
test.ts
File metadata and controls
50 lines (47 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { afterAll, describe, expect, test } from 'vitest';
import { cleanupChildProcesses, createRunner } from '../../../utils/runner';
describe.skip('tedious auto instrumentation', { timeout: 75_000 }, () => {
afterAll(() => {
cleanupChildProcesses();
});
test('should auto-instrument `tedious` package', async () => {
const EXPECTED_TRANSACTION = {
transaction: 'Test Transaction',
spans: expect.arrayContaining([
expect.objectContaining({
description: 'SELECT GETDATE()',
data: expect.objectContaining({
'sentry.origin': 'auto.db.otel.tedious',
'sentry.op': 'db',
'db.name': 'master',
'db.statement': 'SELECT GETDATE()',
'db.system': 'mssql',
'db.user': 'sa',
'net.peer.name': '127.0.0.1',
'net.peer.port': 1433,
}),
status: 'ok',
}),
expect.objectContaining({
description: 'SELECT 1 + 1 AS solution',
data: expect.objectContaining({
'sentry.origin': 'auto.db.otel.tedious',
'sentry.op': 'db',
'db.name': 'master',
'db.statement': 'SELECT 1 + 1 AS solution',
'db.system': 'mssql',
'db.user': 'sa',
'net.peer.name': '127.0.0.1',
'net.peer.port': 1433,
}),
status: 'ok',
}),
]),
};
await createRunner(__dirname, 'scenario.js')
.withDockerCompose({ workingDirectory: [__dirname] })
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
});
});