Skip to content

Commit 2235e10

Browse files
authored
test: Fix nextjs smoke test snapshots (#1668)
1 parent 8357d52 commit 2235e10

2 files changed

Lines changed: 30 additions & 150 deletions

File tree

e2e/scenarios/nextjs-instrumentation/__snapshots__/request-flow.json

Lines changed: 28 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"jsonBody": {
1717
"org_id": "mock-org-id",
18-
"project_name": "e2e-nextjs-instrumentation-nodejs-e2e-<uuid:1>"
18+
"project_name": "<project_name>"
1919
},
2020
"method": "POST",
2121
"path": "/api/project/register",
@@ -30,7 +30,6 @@
3030
"api_version": 2,
3131
"rows": [
3232
{
33-
"_is_merge": false,
3433
"context": {},
3534
"created": "<timestamp>",
3635
"id": "<span:2>",
@@ -46,9 +45,15 @@
4645
"transport": "http"
4746
},
4847
"metrics": {
48+
"end": 0,
4949
"start": 0
5050
},
51-
"project_id": "<uuid:4>",
51+
"output": {
52+
"ok": true,
53+
"route": "/api/smoke-test/node",
54+
"runtime": "nodejs"
55+
},
56+
"project_id": "<project_id>",
5257
"root_span_id": "<span:3>",
5358
"span_attributes": {
5459
"exec_counter": 0,
@@ -66,7 +71,6 @@
6671
"api_version": 2,
6772
"rows": [
6873
{
69-
"_is_merge": false,
7074
"context": {},
7175
"created": "<timestamp>",
7276
"id": "<span:2>",
@@ -82,85 +86,21 @@
8286
"transport": "http"
8387
},
8488
"metrics": {
89+
"end": 0,
8590
"start": 0
8691
},
87-
"project_id": "<uuid:4>",
88-
"root_span_id": "<span:3>",
89-
"span_attributes": {
90-
"exec_counter": 0,
91-
"name": "nextjs nodejs logger span",
92-
"type": "task"
93-
},
94-
"span_id": "<span:3>"
95-
}
96-
]
97-
}
98-
},
99-
{
100-
"headers": {
101-
"content-type": "application/json"
102-
},
103-
"jsonBody": {
104-
"api_version": 2,
105-
"rows": [
106-
{
107-
"_is_merge": true,
108-
"id": "<span:2>",
109-
"input": {
110-
"route": "/api/smoke-test/node",
111-
"runtime": "nodejs"
112-
},
113-
"log_id": "g",
114-
"metadata": {
115-
"runtime": "nodejs",
116-
"scenario": "nextjs-instrumentation",
117-
"testRunId": "<run:1>",
118-
"transport": "http"
119-
},
120-
"metrics": {
121-
"end": 0
122-
},
12392
"output": {
12493
"ok": true,
12594
"route": "/api/smoke-test/node",
12695
"runtime": "nodejs"
12796
},
128-
"project_id": "<uuid:4>",
97+
"project_id": "<project_id>",
12998
"root_span_id": "<span:3>",
130-
"span_id": "<span:3>"
131-
}
132-
]
133-
},
134-
"method": "POST",
135-
"path": "/logs3",
136-
"query": null,
137-
"rawBody": {
138-
"api_version": 2,
139-
"rows": [
140-
{
141-
"_is_merge": true,
142-
"id": "<span:2>",
143-
"input": {
144-
"route": "/api/smoke-test/node",
145-
"runtime": "nodejs"
146-
},
147-
"log_id": "g",
148-
"metadata": {
149-
"runtime": "nodejs",
150-
"scenario": "nextjs-instrumentation",
151-
"testRunId": "<run:1>",
152-
"transport": "http"
153-
},
154-
"metrics": {
155-
"end": 0
156-
},
157-
"output": {
158-
"ok": true,
159-
"route": "/api/smoke-test/node",
160-
"runtime": "nodejs"
99+
"span_attributes": {
100+
"exec_counter": 0,
101+
"name": "nextjs nodejs logger span",
102+
"type": "task"
161103
},
162-
"project_id": "<uuid:4>",
163-
"root_span_id": "<span:3>",
164104
"span_id": "<span:3>"
165105
}
166106
]
@@ -183,7 +123,7 @@
183123
},
184124
"jsonBody": {
185125
"org_id": "mock-org-id",
186-
"project_name": "e2e-nextjs-instrumentation-edge-e2e-<uuid:1>"
126+
"project_name": "<project_name>"
187127
},
188128
"method": "POST",
189129
"path": "/api/project/register",
@@ -198,7 +138,6 @@
198138
"api_version": 2,
199139
"rows": [
200140
{
201-
"_is_merge": false,
202141
"context": {},
203142
"created": "<timestamp>",
204143
"id": "<span:5>",
@@ -214,9 +153,15 @@
214153
"transport": "http"
215154
},
216155
"metrics": {
156+
"end": 0,
217157
"start": 0
218158
},
219-
"project_id": "<uuid:7>",
159+
"output": {
160+
"ok": true,
161+
"route": "/api/smoke-test/edge",
162+
"runtime": "edge"
163+
},
164+
"project_id": "<project_id>",
220165
"root_span_id": "<span:6>",
221166
"span_attributes": {
222167
"exec_counter": 0,
@@ -234,7 +179,6 @@
234179
"api_version": 2,
235180
"rows": [
236181
{
237-
"_is_merge": false,
238182
"context": {},
239183
"created": "<timestamp>",
240184
"id": "<span:5>",
@@ -250,85 +194,21 @@
250194
"transport": "http"
251195
},
252196
"metrics": {
197+
"end": 0,
253198
"start": 0
254199
},
255-
"project_id": "<uuid:7>",
256-
"root_span_id": "<span:6>",
257-
"span_attributes": {
258-
"exec_counter": 0,
259-
"name": "nextjs edge logger span",
260-
"type": "task"
261-
},
262-
"span_id": "<span:6>"
263-
}
264-
]
265-
}
266-
},
267-
{
268-
"headers": {
269-
"content-type": "application/json"
270-
},
271-
"jsonBody": {
272-
"api_version": 2,
273-
"rows": [
274-
{
275-
"_is_merge": true,
276-
"id": "<span:5>",
277-
"input": {
278-
"route": "/api/smoke-test/edge",
279-
"runtime": "edge"
280-
},
281-
"log_id": "g",
282-
"metadata": {
283-
"runtime": "edge",
284-
"scenario": "nextjs-instrumentation",
285-
"testRunId": "<run:1>",
286-
"transport": "http"
287-
},
288-
"metrics": {
289-
"end": 0
290-
},
291200
"output": {
292201
"ok": true,
293202
"route": "/api/smoke-test/edge",
294203
"runtime": "edge"
295204
},
296-
"project_id": "<uuid:7>",
205+
"project_id": "<project_id>",
297206
"root_span_id": "<span:6>",
298-
"span_id": "<span:6>"
299-
}
300-
]
301-
},
302-
"method": "POST",
303-
"path": "/logs3",
304-
"query": null,
305-
"rawBody": {
306-
"api_version": 2,
307-
"rows": [
308-
{
309-
"_is_merge": true,
310-
"id": "<span:5>",
311-
"input": {
312-
"route": "/api/smoke-test/edge",
313-
"runtime": "edge"
314-
},
315-
"log_id": "g",
316-
"metadata": {
317-
"runtime": "edge",
318-
"scenario": "nextjs-instrumentation",
319-
"testRunId": "<run:1>",
320-
"transport": "http"
321-
},
322-
"metrics": {
323-
"end": 0
324-
},
325-
"output": {
326-
"ok": true,
327-
"route": "/api/smoke-test/edge",
328-
"runtime": "edge"
207+
"span_attributes": {
208+
"exec_counter": 0,
209+
"name": "nextjs edge logger span",
210+
"type": "task"
329211
},
330-
"project_id": "<uuid:7>",
331-
"root_span_id": "<span:6>",
332212
"span_id": "<span:6>"
333213
}
334214
]

e2e/scenarios/nextjs-instrumentation/__snapshots__/route-responses.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"instrumentationRegistered": true,
55
"loggerSpanName": "nextjs edge logger span",
66
"otelSpanName": "nextjs edge otel span",
7-
"projectName": "e2e-nextjs-instrumentation-edge-e2e-<uuid:1>",
7+
"projectName": "<project_name>",
88
"route": "/api/smoke-test/edge",
99
"runtime": "edge",
1010
"success": true,
@@ -18,7 +18,7 @@
1818
"instrumentationRegistered": false,
1919
"loggerSpanName": "nextjs nodejs logger span",
2020
"otelSpanName": "nextjs nodejs otel span",
21-
"projectName": "e2e-nextjs-instrumentation-nodejs-e2e-<uuid:1>",
21+
"projectName": "<project_name>",
2222
"route": "/api/smoke-test/node",
2323
"runtime": "nodejs",
2424
"success": true,

0 commit comments

Comments
 (0)