Skip to content

Commit bb891e6

Browse files
committed
fixup! test(astro,cloudflare): Add an E2E test for Astro 6 on Cloudflare
1 parent 453b90e commit bb891e6

2 files changed

Lines changed: 4 additions & 29 deletions

File tree

dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/errors.server.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ test.describe('server-side errors', () => {
3333

3434
expect(errorEvent).toMatchObject({
3535
contexts: {
36-
app: expect.any(Object),
3736
cloud_resource: expect.any(Object),
3837
culture: expect.any(Object),
39-
device: expect.any(Object),
40-
os: expect.any(Object),
4138
runtime: expect.any(Object),
4239
trace: {
4340
span_id: spanId,
@@ -61,9 +58,7 @@ test.describe('server-side errors', () => {
6158
},
6259
platform: 'javascript',
6360
request: {
64-
cookies: {},
6561
headers: expect.objectContaining({
66-
// demonstrates that requestData integration is getting data
6762
host: 'localhost:3030',
6863
'user-agent': expect.any(String),
6964
}),
@@ -76,7 +71,6 @@ test.describe('server-side errors', () => {
7671
packages: expect.any(Array),
7772
version: expect.any(String),
7873
},
79-
server_name: expect.any(String),
8074
timestamp: expect.any(Number),
8175
transaction: 'GET /ssr-error',
8276
});
@@ -147,7 +141,6 @@ test.describe('server-side errors', () => {
147141
},
148142
platform: 'javascript',
149143
request: {
150-
cookies: {},
151144
headers: expect.objectContaining({
152145
accept: expect.any(String),
153146
}),

dev-packages/e2e-tests/test-applications/astro-6-cf-workers/tests/tracing.dynamic.test.ts

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,8 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
6363

6464
expect(serverPageRequestTxn).toMatchObject({
6565
contexts: {
66-
app: expect.any(Object),
6766
cloud_resource: expect.any(Object),
6867
culture: expect.any(Object),
69-
device: expect.any(Object),
70-
os: expect.any(Object),
71-
otel: expect.any(Object),
7268
runtime: expect.any(Object),
7369
trace: {
7470
data: {
@@ -78,7 +74,6 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
7874
'sentry.origin': 'auto.http.astro',
7975
'sentry.sample_rate': 1,
8076
'sentry.source': 'route',
81-
url: expect.stringContaining('/test-ssr'),
8277
'http.request.header.accept': expect.any(String),
8378
'http.request.header.accept_encoding': 'br, gzip',
8479
'http.request.header.accept_language': 'en-US',
@@ -96,9 +91,7 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
9691
event_id: expect.stringMatching(/[a-f0-9]{32}/),
9792
platform: 'javascript',
9893
request: {
99-
cookies: {},
10094
headers: expect.objectContaining({
101-
// demonstrates that request data integration can extract headers
10295
accept: expect.any(String),
10396
'accept-encoding': expect.any(String),
10497
'user-agent': expect.any(String),
@@ -112,7 +105,6 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
112105
packages: expect.any(Array),
113106
version: expect.any(String),
114107
},
115-
server_name: expect.any(String),
116108
spans: expect.any(Array),
117109
start_timestamp: expect.any(Number),
118110
timestamp: expect.any(Number),
@@ -232,7 +224,6 @@ test.describe('nested SSR routes (client, server, server request)', () => {
232224
'sentry.op': 'http.server',
233225
'sentry.origin': 'auto.http.astro',
234226
'sentry.source': 'route',
235-
url: expect.stringContaining('/user-page/myUsername123'),
236227
'http.request.header.accept': expect.any(String),
237228
'http.request.header.accept_encoding': 'br, gzip',
238229
'http.request.header.accept_language': 'en-US',
@@ -247,20 +238,18 @@ test.describe('nested SSR routes (client, server, server request)', () => {
247238
// HTTP client span - actual API URL with client operation
248239
expect(serverRequestHTTPClientSpan).toMatchObject({
249240
op: 'http.client',
250-
origin: 'auto.http.otel.node_fetch',
241+
origin: 'auto.http.fetch',
251242
description: 'GET http://localhost:3030/api/user/myUsername123.json', // http.client does not need to be parametrized
252243
data: {
253244
'sentry.op': 'http.client',
254-
'sentry.origin': 'auto.http.otel.node_fetch',
255-
'url.full': expect.stringContaining('/api/user/myUsername123.json'),
256-
'url.path': '/api/user/myUsername123.json',
245+
'sentry.origin': 'auto.http.fetch',
257246
url: expect.stringContaining('/api/user/myUsername123.json'),
258247
},
259248
});
260249

261250
// Server HTTP request transaction
262251
expect(serverHTTPServerRequestTxn).toMatchObject({
263-
transaction: 'GET /api/user/[userId].json',
252+
transaction: 'GET /api/user/myUsername123.json',
264253
transaction_info: { source: 'route' },
265254
contexts: {
266255
trace: {
@@ -270,12 +259,7 @@ test.describe('nested SSR routes (client, server, server request)', () => {
270259
'sentry.op': 'http.server',
271260
'sentry.origin': 'auto.http.astro',
272261
'sentry.source': 'route',
273-
url: expect.stringContaining('/api/user/myUsername123.json'),
274-
'http.request.header.accept': expect.any(String),
275-
'http.request.header.accept_encoding': 'gzip, deflate',
276-
'http.request.header.accept_language': '*',
277-
'http.request.header.sec_fetch_mode': 'cors',
278-
'http.request.header.user_agent': expect.any(String),
262+
'http.request.header.accept_encoding': 'br, gzip',
279263
},
280264
},
281265
},
@@ -327,7 +311,6 @@ test.describe('nested SSR routes (client, server, server request)', () => {
327311
'sentry.op': 'http.server',
328312
'sentry.origin': 'auto.http.astro',
329313
'sentry.source': 'route',
330-
url: expect.stringContaining('/catchAll/hell0/whatever-do'),
331314
'http.request.header.accept': expect.any(String),
332315
'http.request.header.accept_encoding': 'br, gzip',
333316
'http.request.header.accept_language': 'en-US',
@@ -384,7 +367,6 @@ test.describe('parametrized vs static paths', () => {
384367
'sentry.op': 'http.server',
385368
'sentry.origin': 'auto.http.astro',
386369
'sentry.source': 'route',
387-
url: expect.stringContaining('/user-page/settings'),
388370
'http.request.header.accept': expect.any(String),
389371
'http.request.header.accept_encoding': 'br, gzip',
390372
'http.request.header.accept_language': 'en-US',

0 commit comments

Comments
 (0)