Skip to content

Commit 20adc34

Browse files
authored
Merge branch 'develop' into nh/array-attribute-support
2 parents 01a6851 + 9a4b9b2 commit 20adc34

18 files changed

Lines changed: 407 additions & 276 deletions

File tree

dev-packages/cloudflare-integration-tests/runner.ts

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,33 @@ export function createRunner(...paths: string[]) {
208208

209209
if (process.env.DEBUG) log('Starting scenario', testPath);
210210

211-
const stdio: ('inherit' | 'ipc' | 'ignore')[] = process.env.DEBUG
212-
? ['inherit', 'inherit', 'inherit', 'ipc']
213-
: ['ignore', 'ignore', 'ignore', 'ipc'];
214-
215211
const onChildError = (e: Error) => {
216212
// eslint-disable-next-line no-console
217213
console.error('Error starting child process:', e);
218214
reject(e);
219215
};
220216

221-
function onChildMessage(message: string, onReady?: (port: number) => void): void {
222-
const msg = JSON.parse(message) as { event: string; port?: number };
223-
if (msg.event === 'DEV_SERVER_READY' && typeof msg.port === 'number') {
224-
if (process.env.DEBUG) log('worker ready on port', msg.port);
225-
onReady?.(msg.port);
226-
}
217+
// Inspired by workers-sdk: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/e2e/helpers/wrangler.ts
218+
function waitForReady(childProcess: ReturnType<typeof spawn>): Promise<number> {
219+
return new Promise((resolve, reject) => {
220+
const stdout = childProcess.stdout;
221+
if (!stdout) {
222+
reject(new Error('No stdout available'));
223+
return;
224+
}
225+
226+
let output = '';
227+
stdout.on('data', (chunk: Buffer) => {
228+
const text = chunk.toString();
229+
if (process.env.DEBUG) process.stdout.write(text);
230+
output += text;
231+
232+
const match = output.match(/Ready on (https?:\/\/[^\s]+)/);
233+
if (match?.[1]) {
234+
resolve(parseInt(new URL(match[1]).port, 10));
235+
}
236+
});
237+
});
227238
}
228239

229240
if (existsSync(join(testPath, 'wrangler-sub-worker.jsonc'))) {
@@ -242,17 +253,15 @@ export function createRunner(...paths: string[]) {
242253
'--inspector-port',
243254
'0',
244255
],
245-
{ stdio, signal },
256+
{ stdio: ['ignore', 'pipe', 'inherit'], signal },
246257
);
247258

248-
// Wait for the sub-worker to be ready before starting the main worker
249-
await new Promise<void>((resolveSubWorker, rejectSubWorker) => {
250-
childSubWorker!.on('message', (msg: string) => onChildMessage(msg, () => resolveSubWorker()));
251-
childSubWorker!.on('error', rejectSubWorker);
252-
childSubWorker!.on('exit', code => {
253-
rejectSubWorker(new Error(`Sub-worker exited with code ${code}`));
254-
});
259+
childSubWorker.on('error', onChildError);
260+
childSubWorker.on('exit', code => {
261+
onChildError(new Error(`Sub-worker exited with code ${code}`));
255262
});
263+
264+
await waitForReady(childSubWorker);
256265
}
257266

258267
child = spawn(
@@ -273,7 +282,7 @@ export function createRunner(...paths: string[]) {
273282
'0',
274283
...extraWranglerArgs,
275284
],
276-
{ stdio, signal },
285+
{ stdio: ['ignore', 'pipe', 'inherit'], signal },
277286
);
278287

279288
CLEANUP_STEPS.add(() => {
@@ -283,7 +292,10 @@ export function createRunner(...paths: string[]) {
283292

284293
childSubWorker?.on('error', onChildError);
285294
child.on('error', onChildError);
286-
child.on('message', (msg: string) => onChildMessage(msg, setWorkerPort));
295+
296+
const workerPort = await waitForReady(child);
297+
298+
setWorkerPort(workerPort);
287299
})
288300
.catch(e => reject(e));
289301

dev-packages/e2e-tests/test-applications/browser-webworker-vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@playwright/test": "~1.56.0",
1616
"@sentry-internal/test-utils": "link:../../../test-utils",
1717
"typescript": "~5.8.3",
18-
"vite": "^7.0.4"
18+
"vite": "^7.3.2"
1919
},
2020
"dependencies": {
2121
"@sentry/browser": "file:../../packed/sentry-browser-packed.tgz",

dev-packages/e2e-tests/test-applications/deno-streamed/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"start": "deno run --allow-net --allow-env --allow-read src/app.ts",
6+
"start": "deno run --allow-net --allow-env --allow-read --allow-sys src/app.ts",
77
"test": "playwright test",
88
"clean": "npx rimraf node_modules pnpm-lock.yaml",
99
"test:build": "pnpm install",

dev-packages/e2e-tests/test-applications/deno-streamed/tests/spans.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { waitForStreamedSpans, getSpanOp } from '@sentry-internal/test-utils';
33

44
const SEGMENT_SPAN = {
55
attributes: {
6+
'app.start_time': {
7+
type: 'string',
8+
value: expect.any(String),
9+
},
610
'client.address': {
711
type: 'string',
812
value: expect.any(String),
@@ -11,6 +15,11 @@ const SEGMENT_SPAN = {
1115
type: 'integer',
1216
value: expect.any(Number),
1317
},
18+
// TODO: 'device.archs' is set but arrays are not yet serialized in span attributes
19+
'device.processor_count': {
20+
type: 'integer',
21+
value: expect.any(Number),
22+
},
1423
'http.request.header.accept': {
1524
type: 'string',
1625
value: '*/*',
@@ -51,6 +60,14 @@ const SEGMENT_SPAN = {
5160
type: 'integer',
5261
value: expect.any(Number),
5362
},
63+
'os.name': {
64+
type: 'string',
65+
value: expect.any(String),
66+
},
67+
'os.version': {
68+
type: 'string',
69+
value: expect.any(String),
70+
},
5471
'sentry.environment': {
5572
type: 'string',
5673
value: 'qa',
@@ -115,6 +132,14 @@ const SEGMENT_SPAN = {
115132
type: 'string',
116133
value: 'node',
117134
},
135+
'process.runtime.engine.name': {
136+
type: 'string',
137+
value: 'v8',
138+
},
139+
'process.runtime.engine.version': {
140+
type: 'string',
141+
value: expect.any(String),
142+
},
118143
},
119144
end_timestamp: expect.any(Number),
120145
is_segment: true,

dev-packages/e2e-tests/test-applications/react-router-7-framework-spa-node-20-18/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@types/react-dom": "^19.1.2",
3636
"tailwindcss": "^4.1.4",
3737
"typescript": "^5.8.3",
38-
"vite": "^6.3.3",
38+
"vite": "^6.4.2",
3939
"vite-tsconfig-paths": "^5.1.4"
4040
},
4141
"browserslist": {

dev-packages/e2e-tests/test-applications/react-router-7-framework-spa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@types/react-dom": "^19.1.2",
3636
"tailwindcss": "^4.1.4",
3737
"typescript": "^5.8.3",
38-
"vite": "^6.3.3",
38+
"vite": "^6.4.2",
3939
"vite-tsconfig-paths": "^5.1.4"
4040
},
4141
"browserslist": {

dev-packages/e2e-tests/test-applications/react-router-7-spa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"devDependencies": {
1414
"@playwright/test": "~1.56.0",
1515
"@sentry-internal/test-utils": "link:../../../test-utils",
16-
"vite": "^6.0.1",
16+
"vite": "^6.4.2",
1717
"@vitejs/plugin-react": "^4.3.4",
1818
"typescript": "~5.0.0"
1919
},

dev-packages/e2e-tests/test-applications/solid-tanstack-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@playwright/test": "~1.56.0",
2626
"@sentry-internal/test-utils": "link:../../../test-utils",
2727
"typescript": "^5.7.2",
28-
"vite": "^7.1.7",
28+
"vite": "^7.3.2",
2929
"vite-plugin-solid": "^2.11.2"
3030
},
3131
"volta": {

dev-packages/e2e-tests/test-applications/sveltekit-2-kit-tracing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"svelte-check": "^4.3.1",
2929
"tslib": "^2.4.1",
3030
"typescript": "^5.0.0",
31-
"vite": "^7.1.3"
31+
"vite": "^7.3.2"
3232
},
3333
"type": "module",
3434
"volta": {

dev-packages/e2e-tests/test-applications/sveltekit-cloudflare-pages/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"svelte": "^5.20.2",
2626
"svelte-check": "^4.1.4",
2727
"typescript": "^5.0.0",
28-
"vite": "^6.1.1",
28+
"vite": "^6.4.2",
2929
"wrangler": "^4.61.0"
3030
},
3131
"volta": {

0 commit comments

Comments
 (0)