Skip to content

Commit e0364f3

Browse files
authored
Merge branch 'develop' into cg/fix-slow-test
2 parents 79bec2c + 90f958f commit e0364f3

File tree

48 files changed

+1091
-70
lines changed

Some content is hidden

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

48 files changed

+1091
-70
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,8 @@ jobs:
795795
# - The build job was successful, not skipped
796796
# - AND if the profiling node bindings were either successful or skipped
797797
if: |
798-
always() && needs.job_build.result == 'success' &&
798+
always() &&
799+
needs.job_build.result == 'success' &&
799800
(needs.job_compile_bindings_profiling_node.result == 'success' || needs.job_compile_bindings_profiling_node.result == 'skipped')
800801
needs: [job_get_metadata, job_build, job_compile_bindings_profiling_node]
801802
runs-on: ubuntu-20.04-large-js
@@ -981,13 +982,16 @@ jobs:
981982
directory: dev-packages/e2e-tests
982983
token: ${{ secrets.CODECOV_TOKEN }}
983984

985+
# - We skip optional tests on release branches
984986
job_optional_e2e_tests:
985987
name: E2E ${{ matrix.label || matrix.test-application }} Test
986988
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
987989
# We need to add the `always()` check here because the previous step has this as well :(
988990
# See: https://github.com/actions/runner/issues/2205
989991
if:
990-
always() && needs.job_e2e_prepare.result == 'success' &&
992+
always() &&
993+
needs.job_get_metadata.outputs.is_release != 'true' &&
994+
needs.job_e2e_prepare.result == 'success' &&
991995
needs.job_e2e_prepare.outputs.matrix-optional != '{"include":[]}' &&
992996
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
993997
github.actor != 'dependabot[bot]'

dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr
2323
}
2424
});
2525

26-
const url = await getLocalTestUrl({ testDir: __dirname });
26+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
2727

2828
await page.goto(url);
2929
await page.locator('#custom-feedback-button').click();

dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
2323
}
2424
});
2525

26-
const url = await getLocalTestUrl({ testDir: __dirname });
26+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
2727

2828
await page.goto(url);
2929
await page.getByText('Report a Bug').click();

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
3131
}
3232
});
3333

34-
const url = await getLocalTestUrl({ testDir: __dirname });
34+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
3535

3636
await Promise.all([page.goto(url), page.getByText('Report a Bug').click(), reqPromise0]);
3737

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
2323
}
2424
});
2525

26-
const url = await getLocalTestUrl({ testDir: __dirname });
26+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
2727

2828
await page.goto(url);
2929
await page.getByText('Report a Bug').click();

dev-packages/browser-integration-tests/suites/integrations/lazyLoad/feedbackIntegration/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { sentryTest } from '../../../../utils/fixtures';
55

66
sentryTest('it allows to lazy load the feedback integration', async ({ getLocalTestUrl, page }) => {
77
const bundle = process.env.PW_BUNDLE || '';
8-
const url = await getLocalTestUrl({ testDir: __dirname });
8+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
99

1010
await page.route(`https://browser.sentry-cdn.com/${SDK_VERSION}/feedback.min.js`, route => {
1111
return route.fulfill({

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/template.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
<body>
77
<div id="content"></div>
88
<img src="https://example.com/my/image.png" />
9-
<button type="button">Test button</button>
109
</body>
1110
</html>

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import type { Event } from '@sentry/types';
55
import { sentryTest } from '../../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
77

8-
sentryTest('should capture a LCP vital with element details.', async ({ browserName, getLocalTestUrl, page }) => {
8+
/*
9+
Because we "serve" the html test page as a static file, all requests for the image
10+
are considered 3rd party requests. So the LCP value we obtain for the image is also
11+
considered a 3rd party LCP value, meaning `renderTime` is only set if we also
12+
return the `Timing-Allow-Origin` header.
13+
*/
14+
15+
sentryTest('captures LCP vitals with element details.', async ({ browserName, getLocalTestUrl, page }) => {
916
if (shouldSkipTracingTest() || browserName !== 'chromium') {
1017
sentryTest.skip();
1118
}
@@ -16,17 +23,50 @@ sentryTest('should capture a LCP vital with element details.', async ({ browserN
1623
});
1724

1825
const url = await getLocalTestUrl({ testDir: __dirname });
19-
const [eventData] = await Promise.all([
20-
getFirstSentryEnvelopeRequest<Event>(page),
21-
page.goto(url),
22-
page.locator('button').click(),
23-
]);
26+
const [eventData] = await Promise.all([getFirstSentryEnvelopeRequest<Event>(page), page.goto(url)]);
2427

2528
expect(eventData.measurements).toBeDefined();
2629
expect(eventData.measurements?.lcp?.value).toBeDefined();
2730

28-
// XXX: This should be body > img, but it can be flakey as sometimes it will report
29-
// the button as LCP.
3031
expect(eventData.contexts?.trace?.data?.['lcp.element'].startsWith('body >')).toBe(true);
3132
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBeGreaterThan(0);
33+
expect(eventData.contexts?.trace?.data?.['lcp.loadTime']).toBeGreaterThan(0);
34+
35+
// renderTime is 0 because we don't return the `Timing-Allow-Origin` header
36+
// and the image is loaded from a 3rd party origin
37+
expect(eventData.contexts?.trace?.data?.['lcp.renderTime']).toBe(0);
38+
39+
// The LCP value should be the loadTime because the renderTime is not set
40+
expect(eventData.measurements?.lcp?.value).toBeCloseTo(eventData.contexts?.trace?.data?.['lcp.loadTime']);
3241
});
42+
43+
sentryTest(
44+
'captures LCP renderTime when returning Timing-Allow-Origin header.',
45+
async ({ browserName, getLocalTestUrl, page }) => {
46+
if (shouldSkipTracingTest() || browserName !== 'chromium') {
47+
sentryTest.skip();
48+
}
49+
50+
page.route('**', route => route.continue());
51+
page.route('**/my/image.png', async (route: Route) => {
52+
return route.fulfill({
53+
path: `${__dirname}/assets/sentry-logo-600x179.png`,
54+
headers: { 'Timing-Allow-Origin': '*' },
55+
});
56+
});
57+
58+
const url = await getLocalTestUrl({ testDir: __dirname });
59+
const [eventData] = await Promise.all([getFirstSentryEnvelopeRequest<Event>(page), page.goto(url)]);
60+
61+
expect(eventData.measurements).toBeDefined();
62+
expect(eventData.measurements?.lcp?.value).toBeDefined();
63+
64+
expect(eventData.contexts?.trace?.data?.['lcp.element'].startsWith('body >')).toBe(true);
65+
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBeGreaterThan(0);
66+
expect(eventData.contexts?.trace?.data?.['lcp.loadTime']).toBeGreaterThan(0);
67+
expect(eventData.contexts?.trace?.data?.['lcp.renderTime']).toBeGreaterThan(0);
68+
69+
// The LCP value should be the renderTime because the renderTime is set
70+
expect(eventData.measurements?.lcp?.value).toBeCloseTo(eventData.contexts?.trace?.data?.['lcp.renderTime']);
71+
},
72+
);

dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/navigation/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ sentryTest(
316316
sentryTest.skip();
317317
}
318318

319-
const url = await getLocalTestUrl({ testDir: __dirname });
319+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
320320

321321
// ensure pageload transaction is finished
322322
await getFirstSentryEnvelopeRequest<Event>(page, url);

dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/pageload-meta/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ sentryTest('user feedback event after pageload has pageload traceId in headers',
302302
sentryTest.skip();
303303
}
304304

305-
const url = await getLocalTestUrl({ testDir: __dirname });
305+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
306306

307307
const pageloadEvent = await getFirstSentryEnvelopeRequest<Event>(page, url);
308308
const pageloadTraceContext = pageloadEvent.contexts?.trace;

dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/pageload/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ sentryTest('user feedback event after pageload has pageload traceId in headers',
442442
sentryTest.skip();
443443
}
444444

445-
const url = await getLocalTestUrl({ testDir: __dirname });
445+
const url = await getLocalTestUrl({ testDir: __dirname, handleLazyLoadedFeedback: true });
446446

447447
const pageloadEvent = await getFirstSentryEnvelopeRequest<Event>(page, url);
448448
const pageloadTraceContext = pageloadEvent.contexts?.trace;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
ij_typescript_use_double_quotes = false
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
44+
test-results
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Angular 19
2+
3+
E2E test app for Angular 19 and `@sentry/angular`.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-19": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:application",
15+
"options": {
16+
"outputPath": "dist/angular-19",
17+
"index": "src/index.html",
18+
"browser": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
{
25+
"glob": "**/*",
26+
"input": "public"
27+
}
28+
],
29+
"styles": [
30+
"src/styles.css"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"budgets": [
37+
{
38+
"type": "initial",
39+
"maximumWarning": "500kB",
40+
"maximumError": "1MB"
41+
},
42+
{
43+
"type": "anyComponentStyle",
44+
"maximumWarning": "4kB",
45+
"maximumError": "8kB"
46+
}
47+
],
48+
"outputHashing": "all"
49+
},
50+
"development": {
51+
"optimization": false,
52+
"extractLicenses": false,
53+
"sourceMap": true
54+
}
55+
},
56+
"defaultConfiguration": "production"
57+
},
58+
"serve": {
59+
"builder": "@angular-devkit/build-angular:dev-server",
60+
"configurations": {
61+
"production": {
62+
"buildTarget": "angular-19:build:production"
63+
},
64+
"development": {
65+
"buildTarget": "angular-19:build:development"
66+
}
67+
},
68+
"defaultConfiguration": "development"
69+
},
70+
"extract-i18n": {
71+
"builder": "@angular-devkit/build-angular:extract-i18n"
72+
},
73+
"test": {
74+
"builder": "@angular-devkit/build-angular:karma",
75+
"options": {
76+
"polyfills": [
77+
"zone.js",
78+
"zone.js/testing"
79+
],
80+
"tsConfig": "tsconfig.spec.json",
81+
"assets": [
82+
{
83+
"glob": "**/*",
84+
"input": "public"
85+
}
86+
],
87+
"styles": [
88+
"src/styles.css"
89+
],
90+
"scripts": []
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "angular-19",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"dev": "ng serve",
7+
"proxy": "node start-event-proxy.mjs",
8+
"preview": "http-server dist/angular-19/browser --port 8080",
9+
"build": "ng build",
10+
"watch": "ng build --watch --configuration development",
11+
"test": "playwright test",
12+
"test:build": "pnpm install && npx playwright install && pnpm build",
13+
"test:assert": "playwright test",
14+
"clean": "npx rimraf .angular node_modules pnpm-lock.yaml dist"
15+
},
16+
"private": true,
17+
"dependencies": {
18+
"@angular/animations": "^19.0.0",
19+
"@angular/common": "^19.0.0",
20+
"@angular/compiler": "^19.0.0",
21+
"@angular/core": "^19.0.0",
22+
"@angular/forms": "^19.0.0",
23+
"@angular/platform-browser": "^19.0.0",
24+
"@angular/platform-browser-dynamic": "^19.0.0",
25+
"@angular/router": "^19.0.0",
26+
"@sentry/angular": "* || latest",
27+
"rxjs": "~7.8.0",
28+
"tslib": "^2.3.0",
29+
"zone.js": "~0.15.0"
30+
},
31+
"devDependencies": {
32+
"@angular-devkit/build-angular": "^19.0.0",
33+
"@angular/cli": "^19.0.0",
34+
"@angular/compiler-cli": "^19.0.0",
35+
"@playwright/test": "^1.44.1",
36+
"@sentry-internal/test-utils": "link:../../../test-utils",
37+
"@types/jasmine": "~5.1.0",
38+
"http-server": "^14.1.1",
39+
"jasmine-core": "~5.4.0",
40+
"karma": "~6.4.0",
41+
"karma-chrome-launcher": "~3.2.0",
42+
"karma-coverage": "~2.2.0",
43+
"karma-jasmine": "~5.1.0",
44+
"karma-jasmine-html-reporter": "~2.1.0",
45+
"typescript": "~5.6.2"
46+
}
47+
}

0 commit comments

Comments
 (0)