Skip to content

Commit b6eeb2f

Browse files
committed
adjust tests
1 parent 1eb8846 commit b6eeb2f

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

dev-packages/e2e-tests/test-applications/nestjs-11/tests/span-decorator.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ test('Transaction includes span and correct value for decorated async function',
2222
span_id: expect.stringMatching(/[a-f0-9]{16}/),
2323
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
2424
data: {
25-
'sentry.origin': 'manual',
25+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
2626
'sentry.op': 'wait and return a string',
2727
},
2828
description: 'wait',
2929
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
3030
start_timestamp: expect.any(Number),
3131
status: 'ok',
3232
op: 'wait and return a string',
33-
origin: 'manual',
33+
origin: 'auto.function.nestjs.sentry_traced',
3434
}),
3535
]),
3636
);
@@ -57,15 +57,15 @@ test('Transaction includes span and correct value for decorated sync function',
5757
span_id: expect.stringMatching(/[a-f0-9]{16}/),
5858
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
5959
data: {
60-
'sentry.origin': 'manual',
60+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
6161
'sentry.op': 'return a string',
6262
},
6363
description: 'getString',
6464
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
6565
start_timestamp: expect.any(Number),
6666
status: 'ok',
6767
op: 'return a string',
68-
origin: 'manual',
68+
origin: 'auto.function.nestjs.sentry_traced',
6969
}),
7070
]),
7171
);

dev-packages/e2e-tests/test-applications/nestjs-8/tests/span-decorator.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ test('Transaction includes span and correct value for decorated async function',
2222
span_id: expect.stringMatching(/[a-f0-9]{16}/),
2323
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
2424
data: {
25-
'sentry.origin': 'manual',
25+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
2626
'sentry.op': 'wait and return a string',
2727
},
2828
description: 'wait',
2929
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
3030
start_timestamp: expect.any(Number),
3131
status: 'ok',
3232
op: 'wait and return a string',
33-
origin: 'manual',
33+
origin: 'auto.function.nestjs.sentry_traced',
3434
}),
3535
]),
3636
);
@@ -57,15 +57,15 @@ test('Transaction includes span and correct value for decorated sync function',
5757
span_id: expect.stringMatching(/[a-f0-9]{16}/),
5858
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
5959
data: {
60-
'sentry.origin': 'manual',
60+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
6161
'sentry.op': 'return a string',
6262
},
6363
description: 'getString',
6464
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
6565
start_timestamp: expect.any(Number),
6666
status: 'ok',
6767
op: 'return a string',
68-
origin: 'manual',
68+
origin: 'auto.function.nestjs.sentry_traced',
6969
}),
7070
]),
7171
);

dev-packages/e2e-tests/test-applications/nestjs-basic/tests/span-decorator.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ test('Transaction includes span and correct value for decorated async function',
2222
span_id: expect.stringMatching(/[a-f0-9]{16}/),
2323
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
2424
data: {
25-
'sentry.origin': 'manual',
25+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
2626
'sentry.op': 'wait and return a string',
2727
},
2828
description: 'wait',
2929
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
3030
start_timestamp: expect.any(Number),
3131
status: 'ok',
3232
op: 'wait and return a string',
33-
origin: 'manual',
33+
origin: 'auto.function.nestjs.sentry_traced',
3434
}),
3535
]),
3636
);
@@ -57,15 +57,15 @@ test('Transaction includes span and correct value for decorated sync function',
5757
span_id: expect.stringMatching(/[a-f0-9]{16}/),
5858
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
5959
data: {
60-
'sentry.origin': 'manual',
60+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
6161
'sentry.op': 'return a string',
6262
},
6363
description: 'getString',
6464
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
6565
start_timestamp: expect.any(Number),
6666
status: 'ok',
6767
op: 'return a string',
68-
origin: 'manual',
68+
origin: 'auto.function.nestjs.sentry_traced',
6969
}),
7070
]),
7171
);

dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/span-decorator.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ test('Transaction includes span and correct value for decorated async function',
2222
span_id: expect.stringMatching(/[a-f0-9]{16}/),
2323
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
2424
data: {
25-
'sentry.origin': 'manual',
25+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
2626
'sentry.op': 'wait and return a string',
2727
},
2828
description: 'wait',
2929
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
3030
start_timestamp: expect.any(Number),
3131
status: 'ok',
3232
op: 'wait and return a string',
33-
origin: 'manual',
33+
origin: 'auto.function.nestjs.sentry_traced',
3434
}),
3535
]),
3636
);
@@ -57,15 +57,15 @@ test('Transaction includes span and correct value for decorated sync function',
5757
span_id: expect.stringMatching(/[a-f0-9]{16}/),
5858
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
5959
data: {
60-
'sentry.origin': 'manual',
60+
'sentry.origin': 'auto.function.nestjs.sentry_traced',
6161
'sentry.op': 'return a string',
6262
},
6363
description: 'getString',
6464
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
6565
start_timestamp: expect.any(Number),
6666
status: 'ok',
6767
op: 'return a string',
68-
origin: 'manual',
68+
origin: 'auto.function.nestjs.sentry_traced',
6969
}),
7070
]),
7171
);

packages/nestjs/test/decorators.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ describe('SentryTraced decorator', () => {
3939
{
4040
op: 'test-operation',
4141
name: 'testMethod',
42+
attributes: {
43+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nestjs.sentry_traced',
44+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'test-operation',
45+
},
4246
},
4347
expect.any(Function),
4448
);
@@ -68,6 +72,10 @@ describe('SentryTraced decorator', () => {
6872
{
6973
op: 'function', // default value
7074
name: 'testDefaultOp',
75+
attributes: {
76+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nestjs.sentry_traced',
77+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'function',
78+
},
7179
},
7280
expect.any(Function),
7381
);

0 commit comments

Comments
 (0)