Skip to content

Commit 65fc6d4

Browse files
chargomeclaude
andauthored
test(e2e): Fix header attribute keys in node-fastify-6 tests (#24363)
The Fastify 6 e2e app was branched before #24222 normalized `http.request.header.*` keys to keep dashes, so its assertions still expected the underscore form and both `node-fastify-6` jobs fail on `develop`. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 17c56c7 commit 65fc6d4

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎dev-packages/e2e-tests/test-applications/node-fastify-6/tests/propagation.test.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
9292
'http.response.status_text': { value: 'OK', type: 'string' },
9393
'http.route': { value: '/test-outgoing-http/:id', type: 'string' },
9494
'http.request.header.accept': { value: '*/*', type: 'string' },
95-
'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' },
96-
'http.request.header.accept_language': { value: '*', type: 'string' },
95+
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
96+
'http.request.header.accept-language': { value: '*', type: 'string' },
9797
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
9898
'http.request.header.host': { value: 'localhost:3030', type: 'string' },
99-
'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' },
100-
'http.request.header.user_agent': { value: 'node', type: 'string' },
99+
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
100+
'http.request.header.user-agent': { value: 'node', type: 'string' },
101101
}),
102102
}),
103103
);
@@ -134,7 +134,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
134134
'http.request.header.baggage': { value: expect.any(String), type: 'string' },
135135
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
136136
'http.request.header.host': { value: expect.any(String), type: 'string' },
137-
'http.request.header.sentry_trace': {
137+
'http.request.header.sentry-trace': {
138138
value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/),
139139
type: 'string',
140140
},
@@ -233,12 +233,12 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
233233
'http.response.status_text': { value: 'OK', type: 'string' },
234234
'http.route': { value: '/test-outgoing-fetch/:id', type: 'string' },
235235
'http.request.header.accept': { value: '*/*', type: 'string' },
236-
'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' },
237-
'http.request.header.accept_language': { value: '*', type: 'string' },
236+
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
237+
'http.request.header.accept-language': { value: '*', type: 'string' },
238238
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
239239
'http.request.header.host': { value: expect.any(String), type: 'string' },
240-
'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' },
241-
'http.request.header.user_agent': { value: 'node', type: 'string' },
240+
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
241+
'http.request.header.user-agent': { value: 'node', type: 'string' },
242242
}),
243243
}),
244244
);
@@ -274,17 +274,17 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
274274
'user_agent.original': { value: 'node', type: 'string' },
275275
'http.route': { value: '/test-inbound-headers/:id', type: 'string' },
276276
'http.request.header.accept': { value: '*/*', type: 'string' },
277-
'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' },
278-
'http.request.header.accept_language': { value: '*', type: 'string' },
277+
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
278+
'http.request.header.accept-language': { value: '*', type: 'string' },
279279
'http.request.header.baggage': { value: expect.any(String), type: 'string' },
280280
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
281281
'http.request.header.host': { value: expect.any(String), type: 'string' },
282-
'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' },
283-
'http.request.header.sentry_trace': {
282+
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
283+
'http.request.header.sentry-trace': {
284284
value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/),
285285
type: 'string',
286286
},
287-
'http.request.header.user_agent': { value: 'node', type: 'string' },
287+
'http.request.header.user-agent': { value: 'node', type: 'string' },
288288
}),
289289
}),
290290
);

‎dev-packages/e2e-tests/test-applications/node-fastify-6/tests/spans.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ test('Sends an API route span', async ({ baseURL }) => {
4545
'http.response.status_text': { value: 'OK', type: 'string' },
4646
'http.route': { value: '/test-transaction', type: 'string' },
4747
'http.request.header.accept': { value: '*/*', type: 'string' },
48-
'http.request.header.accept_encoding': { value: 'gzip, deflate', type: 'string' },
49-
'http.request.header.accept_language': { value: '*', type: 'string' },
48+
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
49+
'http.request.header.accept-language': { value: '*', type: 'string' },
5050
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
5151
'http.request.header.host': { value: expect.any(String), type: 'string' },
52-
'http.request.header.sec_fetch_mode': { value: 'cors', type: 'string' },
53-
'http.request.header.user_agent': { value: 'node', type: 'string' },
52+
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
53+
'http.request.header.user-agent': { value: 'node', type: 'string' },
5454
}),
5555
}),
5656
);
@@ -139,8 +139,8 @@ test('Captures request metadata', async ({ baseURL }) => {
139139
expect.stringMatching(/^http:\/\/localhost:(\d+)\/test-post$/),
140140
);
141141
expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST');
142-
expect(segmentEvent.attributes['http.request.header.user_agent']?.value).toEqual(expect.stringContaining(''));
143-
expect(segmentEvent.attributes['http.request.header.content_type']?.value).toEqual('application/json');
142+
expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual(expect.stringContaining(''));
143+
expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json');
144144

145145
expect(segmentEvent.attributes['http.request.body.data']?.value).toBe(JSON.stringify({ foo: 'bar', other: 1 }));
146146
expect(segmentEvent.attributes['user.ip_address']?.value).toEqual('::1');

0 commit comments

Comments
 (0)