Skip to content

test(browser-integration-tests): Check for full equality in error event trace context #11681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,15 @@ sentryTest('error during navigation has new navigation traceId', async ({ getLoc
});

const errorTraceContext = errorEvent?.contexts?.trace;
expect(errorTraceContext).toMatchObject({
expect(errorTraceContext).toEqual({
data: {
'sentry.op': 'navigation',
'sentry.origin': 'auto.navigation.browser',
'sentry.sample_rate': 1,
'sentry.source': 'url',
},
op: 'navigation',
origin: 'auto.navigation.browser',
trace_id: navigationTraceContext?.trace_id,
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ sentryTest('error after <meta> tag pageload has pageload traceId', async ({ getL
await page.locator('#errorBtn').click();
const [errorEvent, errorTraceHeader] = await errorEventPromise;

expect(errorEvent.contexts?.trace).toMatchObject({
expect(errorEvent.contexts?.trace).toEqual({
trace_id: META_TAG_TRACE_ID,
parent_span_id: META_TAG_PARENT_SPAN_ID,
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
Expand Down Expand Up @@ -167,7 +167,15 @@ sentryTest('error during <meta> tag pageload has pageload traceId', async ({ get
trace_id: META_TAG_TRACE_ID,
});

expect(errorEvent?.contexts?.trace).toMatchObject({
expect(errorEvent?.contexts?.trace).toEqual({
data: {
'sentry.op': 'pageload',
'sentry.origin': 'auto.pageload.browser',
'sentry.sample_rate': 1,
'sentry.source': 'url',
},
op: 'pageload',
origin: 'auto.pageload.browser',
trace_id: META_TAG_TRACE_ID,
parent_span_id: META_TAG_PARENT_SPAN_ID,
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,15 @@ sentryTest('error during pageload has pageload traceId', async ({ getLocalTestPa
});

const errorTraceContext = errorEvent?.contexts?.trace;
expect(errorTraceContext).toMatchObject({
expect(errorTraceContext).toEqual({
data: {
'sentry.op': 'pageload',
'sentry.origin': 'auto.pageload.browser',
'sentry.sample_rate': 1,
'sentry.source': 'url',
},
op: 'pageload',
origin: 'auto.pageload.browser',
trace_id: pageloadTraceContext?.trace_id,
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
});
Expand Down