Skip to content

Commit 77a07e2

Browse files
authored
Merge branch 'develop' into sig/vue-error-throw
2 parents 964dfc7 + 3e73850 commit 77a07e2

File tree

76 files changed

+883
-700
lines changed

Some content is hidden

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

76 files changed

+883
-700
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,8 @@ jobs:
12021202
- name: Run E2E test
12031203
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
12041204
timeout-minutes: 10
1205-
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:assert
1205+
run: |
1206+
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:assert
12061207
12071208
job_required_jobs_passed:
12081209
name: All required jobs passed or were skipped

dev-packages/browser-integration-tests/suites/public-api/startSpan/parallel-root-spans-with-parentSpanId/subject.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Sentry.getCurrentScope().setPropagationContext({
22
parentSpanId: '1234567890123456',
3-
spanId: '123456789012345x',
43
traceId: '12345678901234567890123456789012',
54
});
65

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: integrations => {
8+
integrations.push(Sentry.browserTracingIntegration());
9+
return integrations.filter(i => i.name !== 'BrowserSession');
10+
},
11+
tracesSampleRate: 0,
12+
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Sentry.captureException(new Error('test error'));
2+
Sentry.captureException(new Error('test error 2'));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="sentry-trace" content="12312012123120121231201212312012-1121201211212012" />
6+
<meta
7+
name="baggage"
8+
content="sentry-release=2.1.12,sentry-public_key=public,sentry-trace_id=123"
9+
/>
10+
</head>
11+
</html>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/browser';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { getMultipleSentryEnvelopeRequests, shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest('errors in TwP mode have same trace ID & span IDs', async ({ getLocalTestUrl, page }) => {
7+
if (shouldSkipTracingTest()) {
8+
sentryTest.skip();
9+
}
10+
11+
const traceId = '12312012123120121231201212312012';
12+
const spanId = '1121201211212012';
13+
14+
const url = await getLocalTestUrl({ testDir: __dirname });
15+
const [event1, event2] = await getMultipleSentryEnvelopeRequests<Event>(page, 2, { url });
16+
17+
// Ensure these are the actual errors we care about
18+
expect(event1.exception?.values?.[0].value).toContain('test error');
19+
expect(event2.exception?.values?.[0].value).toContain('test error');
20+
21+
const contexts1 = event1.contexts;
22+
const { trace_id: traceId1, span_id: spanId1 } = contexts1?.trace || {};
23+
expect(traceId1).toEqual(traceId);
24+
25+
// Span ID is a virtual span, not the propagated one
26+
expect(spanId1).not.toEqual(spanId);
27+
expect(spanId1).toMatch(/^[a-f0-9]{16}$/);
28+
29+
const contexts2 = event2.contexts;
30+
const { trace_id: traceId2, span_id: spanId2 } = contexts2?.trace || {};
31+
expect(traceId2).toEqual(traceId);
32+
expect(spanId2).toMatch(/^[a-f0-9]{16}$/);
33+
34+
expect(spanId2).toEqual(spanId1);
35+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: integrations => {
8+
integrations.push(Sentry.browserTracingIntegration());
9+
return integrations.filter(i => i.name !== 'BrowserSession');
10+
},
11+
tracesSampleRate: 0,
12+
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Sentry.captureException(new Error('test error'));
2+
Sentry.captureException(new Error('test error 2'));
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/browser';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { getMultipleSentryEnvelopeRequests, shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest('errors in TwP mode have same trace ID & span IDs', async ({ getLocalTestUrl, page }) => {
7+
if (shouldSkipTracingTest()) {
8+
sentryTest.skip();
9+
}
10+
11+
const url = await getLocalTestUrl({ testDir: __dirname });
12+
const [event1, event2] = await getMultipleSentryEnvelopeRequests<Event>(page, 2, { url });
13+
14+
// Ensure these are the actual errors we care about
15+
expect(event1.exception?.values?.[0].value).toContain('test error');
16+
expect(event2.exception?.values?.[0].value).toContain('test error');
17+
18+
const contexts1 = event1.contexts;
19+
const { trace_id: traceId1, span_id: spanId1 } = contexts1?.trace || {};
20+
expect(traceId1).toMatch(/^[a-f0-9]{32}$/);
21+
expect(spanId1).toMatch(/^[a-f0-9]{16}$/);
22+
23+
const contexts2 = event2.contexts;
24+
const { trace_id: traceId2, span_id: spanId2 } = contexts2?.trace || {};
25+
expect(traceId2).toMatch(/^[a-f0-9]{32}$/);
26+
expect(spanId2).toMatch(/^[a-f0-9]{16}$/);
27+
28+
expect(traceId2).toEqual(traceId1);
29+
expect(spanId2).toEqual(spanId1);
30+
});

dev-packages/e2e-tests/test-applications/node-profiling/build.mjs renamed to dev-packages/e2e-tests/test-applications/node-profiling/build-cjs.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ console.log('Running build using esbuild version', esbuild.version);
1111
esbuild.buildSync({
1212
platform: 'node',
1313
entryPoints: ['./index.ts'],
14-
outdir: './dist',
14+
outfile: './dist/cjs/index.js',
1515
target: 'esnext',
1616
format: 'cjs',
1717
bundle: true,
1818
loader: { '.node': 'copy' },
19+
external: ['@sentry/node', '@sentry/profiling-node'],
1920
});

0 commit comments

Comments
 (0)