Skip to content

Commit 296f4c2

Browse files
committed
adjust node integration tests
1 parent 97fbd3a commit 296f4c2

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

packages/node-integration-tests/suites/express/sentry-trace/baggage-header-assign/test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33
import { getAPIResponse, runServer } from '../../../../utils/index';
44
import { TestAPIResponse } from '../server';
55

6-
test('Should assign `baggage` header which contains 3rd party trace baggage data of an outgoing request.', async () => {
6+
test('Should assign `baggage` header which contains 3rd party trace baggage data to an outgoing request.', async () => {
77
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);
88

99
const response = (await getAPIResponse(new URL(`${url}/express`), {
@@ -14,39 +14,39 @@ test('Should assign `baggage` header which contains 3rd party trace baggage data
1414
expect(response).toMatchObject({
1515
test_data: {
1616
host: 'somewhere.not.sentry',
17-
baggage: expect.stringContaining('foo=bar,bar=baz'),
17+
baggage: 'foo=bar,bar=baz,sentry-environment=prod,sentry-release=1.0',
1818
},
1919
});
2020
});
2121

22-
test('Should assign `baggage` header which contains sentry trace baggage data of an outgoing request.', async () => {
22+
test('Should assign `baggage` header which contains sentry trace baggage data to an outgoing request.', async () => {
2323
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);
2424

2525
const response = (await getAPIResponse(new URL(`${url}/express`), {
26-
baggage: 'sentry-version=1.0.0,sentry-environment=production',
26+
baggage: 'sentry-version=2.0.0,sentry-environment=myEnv',
2727
})) as TestAPIResponse;
2828

2929
expect(response).toBeDefined();
3030
expect(response).toMatchObject({
3131
test_data: {
3232
host: 'somewhere.not.sentry',
33-
baggage: expect.stringContaining('sentry-version=1.0.0,sentry-environment=production'),
33+
baggage: 'sentry-version=2.0.0,sentry-environment=myEnv',
3434
},
3535
});
3636
});
3737

38-
test('Should assign `baggage` header which contains sentry and 3rd party trace baggage data of an outgoing request.', async () => {
38+
test('Should assign `baggage` header which contains sentry and 3rd party trace baggage data to an outgoing request.', async () => {
3939
const url = await runServer(__dirname, `${path.resolve(__dirname, '..')}/server.ts`);
4040

4141
const response = (await getAPIResponse(new URL(`${url}/express`), {
42-
baggage: 'sentry-version=1.0.0,sentry-environment=production,dogs=great',
42+
baggage: 'sentry-version=2.0.0,sentry-environment=myEnv,dogs=great',
4343
})) as TestAPIResponse;
4444

4545
expect(response).toBeDefined();
4646
expect(response).toMatchObject({
4747
test_data: {
4848
host: 'somewhere.not.sentry',
49-
baggage: expect.stringContaining('dogs=great,sentry-version=1.0.0,sentry-environment=production'),
49+
baggage: expect.stringContaining('dogs=great,sentry-version=2.0.0,sentry-environment=myEnv'),
5050
},
5151
});
5252
});

packages/node-integration-tests/suites/express/sentry-trace/baggage-header-out/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ test('should attach a `baggage` header to an outgoing request.', async () => {
1212
expect(response).toMatchObject({
1313
test_data: {
1414
host: 'somewhere.not.sentry',
15-
// TODO this is currently still empty but eventually it should contain sentry data
16-
baggage: expect.stringMatching(''),
15+
baggage: expect.stringMatching('sentry-environment=prod,sentry-release=1.0'),
1716
},
1817
});
1918
});

packages/node-integration-tests/suites/express/sentry-trace/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type TestAPIResponse = { test_data: { host: string; 'sentry-trace': strin
1111
Sentry.init({
1212
dsn: 'https://[email protected]/1337',
1313
release: '1.0',
14+
environment: 'prod',
1415
integrations: [new Sentry.Integrations.Http({ tracing: true }), new Tracing.Integrations.Express({ app })],
1516
tracesSampleRate: 1.0,
1617
});

packages/types/src/span.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,4 @@ export interface Span extends SpanContext {
178178

179179
/** return the baggage for dynamic sampling and trace propagation */
180180
getBaggage(): Baggage | undefined;
181-
182-
//_getBaggageWithSentryValues(baggage: Baggage): Baggage;
183181
}

0 commit comments

Comments
 (0)