Skip to content

Commit 01bc887

Browse files
author
Luca Forstner
committed
Merge remote-tracking branch 'origin/develop' into lforst-nextjs-otel
2 parents eb1c1cd + 8b1f130 commit 01bc887

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1656
-224
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
'examples/**',
2222
'test/manual/**',
2323
'types/**',
24+
'scripts/*.js',
2425
],
2526
reportUnusedDisableDirectives: true,
2627
overrides: [

.github/workflows/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ jobs:
921921
'tanstack-router',
922922
'generic-ts3.8',
923923
'node-fastify',
924+
'node-fastify-5',
924925
'node-hapi',
925926
'node-nestjs-basic',
926927
'node-nestjs-distributed-tracing',
@@ -1034,6 +1035,15 @@ jobs:
10341035
overwrite: true
10351036
retention-days: 7
10361037

1038+
- name: Upload E2E Test Event Dumps
1039+
uses: actions/upload-artifact@v4
1040+
if: always()
1041+
with:
1042+
name: playwright-event-dumps-job_e2e_playwright_tests-${{ matrix.test-application }}
1043+
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/event-dumps
1044+
overwrite: true
1045+
retention-days: 7
1046+
10371047
- name: Upload test results to Codecov
10381048
if: cancelled() == false
10391049
continue-on-error: true

.github/workflows/release-comment-issues.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ jobs:
2020
run: echo "version=${{ github.event.inputs.version || github.event.release.tag_name }}" >> $GITHUB_OUTPUT
2121

2222
- name: Comment on linked issues that are mentioned in release
23-
if: steps.get_version.outputs.version != ''
23+
if: |
24+
steps.get_version.outputs.version != ''
25+
&& !contains(steps.get_version.outputs.version, '-beta.')
26+
&& !contains(steps.get_version.outputs.version, '-alpha.')
27+
&& !contains(steps.get_version.outputs.version, '-rc.')
28+
2429
uses: getsentry/release-comment-issues-gh-action@v1
2530
with:
2631
github_token: ${{ secrets.GITHUB_TOKEN }}

dev-packages/browser-integration-tests/suites/replay/bufferModeManual/test.ts

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,125 @@ sentryTest(
287287
},
288288
);
289289

290+
sentryTest(
291+
'[buffer-mode] manually starting replay ignores earlier performance entries',
292+
async ({ getLocalTestUrl, page, browserName }) => {
293+
// This was sometimes flaky on webkit, so skipping for now
294+
if (shouldSkipReplayTest() || browserName === 'webkit') {
295+
sentryTest.skip();
296+
}
297+
298+
const reqPromise0 = waitForReplayRequest(page, 0);
299+
300+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
301+
return route.fulfill({
302+
status: 200,
303+
contentType: 'application/json',
304+
body: JSON.stringify({ id: 'test-id' }),
305+
});
306+
});
307+
308+
const url = await getLocalTestUrl({ testDir: __dirname });
309+
310+
await page.goto(url);
311+
312+
// Wait for everything to be initialized - Replay is not running yet
313+
await page.waitForFunction('!!window.Replay');
314+
315+
// Wait for a second, then start replay
316+
await new Promise(resolve => setTimeout(resolve, 1000));
317+
await page.evaluate('window.Replay.start()');
318+
319+
const req0 = await reqPromise0;
320+
321+
const event0 = getReplayEvent(req0);
322+
const content0 = getReplayRecordingContent(req0);
323+
324+
expect(event0).toEqual(
325+
getExpectedReplayEvent({
326+
replay_type: 'session',
327+
}),
328+
);
329+
330+
const { performanceSpans } = content0;
331+
332+
// Here, we test that this does not contain any web-vital etc. performance spans
333+
// as these have been emitted _before_ the replay was manually started
334+
expect(performanceSpans).toEqual([
335+
{
336+
op: 'memory',
337+
description: 'memory',
338+
startTimestamp: expect.any(Number),
339+
endTimestamp: expect.any(Number),
340+
data: {
341+
memory: {
342+
jsHeapSizeLimit: expect.any(Number),
343+
totalJSHeapSize: expect.any(Number),
344+
usedJSHeapSize: expect.any(Number),
345+
},
346+
},
347+
},
348+
]);
349+
},
350+
);
351+
352+
sentryTest(
353+
'[buffer-mode] manually starting replay ignores earlier performance entries when starting immediately',
354+
async ({ getLocalTestUrl, page, browserName }) => {
355+
// This was sometimes flaky on webkit, so skipping for now
356+
if (shouldSkipReplayTest() || browserName === 'webkit') {
357+
sentryTest.skip();
358+
}
359+
360+
const reqPromise0 = waitForReplayRequest(page, 0);
361+
362+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
363+
return route.fulfill({
364+
status: 200,
365+
contentType: 'application/json',
366+
body: JSON.stringify({ id: 'test-id' }),
367+
});
368+
});
369+
370+
const url = await getLocalTestUrl({ testDir: __dirname });
371+
372+
page.goto(url);
373+
374+
// Wait for everything to be initialized, then start replay as soon as possible
375+
await page.waitForFunction('!!window.Replay');
376+
await page.evaluate('window.Replay.start()');
377+
378+
const req0 = await reqPromise0;
379+
380+
const event0 = getReplayEvent(req0);
381+
const content0 = getReplayRecordingContent(req0);
382+
383+
expect(event0).toEqual(
384+
getExpectedReplayEvent({
385+
replay_type: 'session',
386+
}),
387+
);
388+
389+
const { performanceSpans } = content0;
390+
391+
expect(performanceSpans).toEqual([
392+
{
393+
op: 'memory',
394+
description: 'memory',
395+
startTimestamp: expect.any(Number),
396+
endTimestamp: expect.any(Number),
397+
data: {
398+
memory: {
399+
jsHeapSizeLimit: expect.any(Number),
400+
totalJSHeapSize: expect.any(Number),
401+
usedJSHeapSize: expect.any(Number),
402+
},
403+
},
404+
},
405+
]);
406+
},
407+
);
408+
290409
// Doing this in buffer mode to test changing error sample rate after first
291410
// error happens.
292411
sentryTest(

dev-packages/e2e-tests/test-applications/astro-4/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"test:assert": "TEST_ENV=production playwright test"
1313
},
1414
"dependencies": {
15-
"@astrojs/check": "^0.9.2",
16-
"@astrojs/node": "^8.3.2",
15+
"@astrojs/check": "0.9.2",
16+
"@astrojs/node": "8.3.2",
1717
"@playwright/test": "^1.46.0",
1818
"@sentry/astro": "* || latest",
1919
"@sentry-internal/test-utils": "link:../../../test-utils",
20-
"@spotlightjs/astro": "^2.1.6",
21-
"astro": "^4.13.3",
20+
"@spotlightjs/astro": "2.1.6",
21+
"astro": "4.13.3",
2222
"typescript": "^5.5.4"
2323
},
2424
"devDependencies": {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"dependencies": {
2020
"@astrojs/cloudflare": "8.1.0",
2121
"@sentry/astro": "latest || *",
22-
"astro": "4.1.1"
22+
"astro": "4.16.1"
23+
},
24+
"devDependencies": {
25+
"@astrojs/internal-helpers": "0.4.1"
2326
},
2427
"volta": {
2528
"extends": "../../package.json"

dev-packages/e2e-tests/test-applications/nextjs-15/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ next-env.d.ts
4343
.vscode
4444

4545
test-results
46+
event-dumps

dev-packages/e2e-tests/test-applications/nextjs-15/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
13
import { startEventProxyServer } from '@sentry-internal/test-utils';
24

5+
const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));
6+
37
startEventProxyServer({
48
port: 3031,
59
proxyServerName: 'nextjs-15',
10+
envelopeDumpPath: path.join(
11+
process.cwd(),
12+
`event-dumps/next-${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
13+
),
614
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

0 commit comments

Comments
 (0)