Skip to content

Commit bb41f80

Browse files
authored
Merge branch 'develop' into byk/fix/spotlight-dev-mode-warn
2 parents 2db3c31 + c297bf9 commit bb41f80

61 files changed

Lines changed: 1356 additions & 331 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,13 @@ jobs:
886886
- uses: pnpm/action-setup@v4
887887
with:
888888
version: 9.4.0
889+
- name: Set up Node for Angular 20
890+
if: matrix.test-application == 'angular-20'
891+
uses: actions/setup-node@v4
892+
with:
893+
node-version: '20.19.2'
889894
- name: Set up Node
895+
if: matrix.test-application != 'angular-20'
890896
uses: actions/setup-node@v4
891897
with:
892898
node-version-file: 'dev-packages/e2e-tests/package.json'

dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ sentryTest(
1818
return !!(window as any).Sentry.isInitialized();
1919
});
2020

21-
expect(isInitialized).toEqual(false);
21+
const isEnabled = await page.evaluate(() => {
22+
return !!(window as any).Sentry.getClient()?.getOptions().enabled;
23+
});
24+
25+
expect(isInitialized).toEqual(true);
26+
expect(isEnabled).toEqual(false);
2227

2328
if (hasDebugLogs()) {
2429
expect(errorLogs.length).toEqual(1);

dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ sentryTest('should not initialize when inside a Chrome browser extension', async
1616
return !!(window as any).Sentry.isInitialized();
1717
});
1818

19-
expect(isInitialized).toEqual(false);
19+
const isEnabled = await page.evaluate(() => {
20+
return !!(window as any).Sentry.getClient()?.getOptions().enabled;
21+
});
22+
23+
expect(isInitialized).toEqual(true);
24+
expect(isEnabled).toEqual(false);
2025

2126
if (hasDebugLogs()) {
2227
expect(errorLogs.length).toEqual(1);

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/multiple-integrations/test.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(() => {
2+
// I do nothing.
3+
})();

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/multiple-integrations/init.js renamed to dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/resource-spans-ignored/init.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7-
integrations: [Sentry.browserTracingIntegration(), Sentry.browserTracingIntegration()],
7+
integrations: [
8+
Sentry.browserTracingIntegration({
9+
ignoreResourceSpans: ['resource.script'],
10+
idleTimeout: 9000,
11+
}),
12+
],
813
tracesSampleRate: 1,
914
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { Route } from '@playwright/test';
2+
import { expect } from '@playwright/test';
3+
import type { Event } from '@sentry/core';
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
6+
7+
sentryTest('should allow specific types of resource spans to be ignored.', async ({ getLocalTestUrl, page }) => {
8+
if (shouldSkipTracingTest()) {
9+
sentryTest.skip();
10+
}
11+
12+
await page.route('**/path/to/script.js', (route: Route) => route.fulfill({ path: `${__dirname}/assets/script.js` }));
13+
14+
const url = await getLocalTestUrl({ testDir: __dirname });
15+
16+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
17+
const allSpans = eventData.spans?.filter(({ op }) => op?.startsWith('resource.script'));
18+
19+
expect(allSpans?.length).toBe(0);
20+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: ['http://sentry-test-site.example'],
9+
tracesSampleRate: 1,
10+
autoSessionTracking: false,
11+
});
12+
13+
// fetch directly after init
14+
fetch('http://sentry-test-site.example/0');
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { expect } from '@playwright/test';
2+
import { sentryTest } from '../../../../utils/fixtures';
3+
import {
4+
envelopeRequestParser,
5+
shouldSkipTracingTest,
6+
waitForTransactionRequestOnUrl,
7+
} from '../../../../utils/helpers';
8+
9+
sentryTest('should create spans for fetch requests called directly after init', async ({ getLocalTestUrl, page }) => {
10+
if (shouldSkipTracingTest()) {
11+
sentryTest.skip();
12+
}
13+
14+
await page.route('http://sentry-test-site.example/*', route => route.fulfill({ body: 'ok' }));
15+
16+
const url = await getLocalTestUrl({ testDir: __dirname });
17+
18+
const req = await waitForTransactionRequestOnUrl(page, url);
19+
const tracingEvent = envelopeRequestParser(req);
20+
21+
const requestSpans = tracingEvent.spans?.filter(({ op }) => op === 'http.client');
22+
23+
expect(requestSpans).toHaveLength(1);
24+
25+
expect(requestSpans![0]).toMatchObject({
26+
description: 'GET http://sentry-test-site.example/0',
27+
parent_span_id: tracingEvent.contexts?.trace?.span_id,
28+
span_id: expect.stringMatching(/[a-f0-9]{16}/),
29+
start_timestamp: expect.any(Number),
30+
timestamp: expect.any(Number),
31+
trace_id: tracingEvent.contexts?.trace?.trace_id,
32+
data: {
33+
'http.method': 'GET',
34+
'http.url': 'http://sentry-test-site.example/0',
35+
url: 'http://sentry-test-site.example/0',
36+
'server.address': 'sentry-test-site.example',
37+
type: 'fetch',
38+
},
39+
});
40+
});
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

0 commit comments

Comments
 (0)