Skip to content

Commit 040cd31

Browse files
Lms24claude
andcommitted
test: Account for sentry.is_localhost in exact span assertions
Tests that compare a whole span (or its full attribute bag) with `toEqual` need the new attribute spelled out. Spans of a request served over localhost get `true`; spans with no request in scope (db scripts, `sentry-test.io` browser pages) get `false`. Also bumps the `@sentry/cloudflare (withSentry)` size limit, which the extra matching logic pushes 892 bytes over, and drops `spanStreamingIntegration()` from the new browser test since streaming is the v11 default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 88f9030 commit 040cd31

20 files changed

Lines changed: 47 additions & 2 deletions

File tree

‎.size-limit.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ module.exports = [
504504
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
505505
gzip: false,
506506
brotli: false,
507-
limit: '500 KiB',
507+
limit: '501 KiB',
508508
disablePlugins: ['@size-limit/webpack'],
509509
webpack: false,
510510
modifyEsbuildConfig: function (config) {

‎dev-packages/browser-integration-tests/suites/public-api/startSpan/streamed/test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ sentryTest(
7676
expect(spans).toEqual([
7777
{
7878
attributes: {
79+
'sentry.is_localhost': { value: false, type: 'boolean' },
7980
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: {
8081
type: 'string',
8182
value: 'test-child',
@@ -124,6 +125,7 @@ sentryTest(
124125
},
125126
{
126127
attributes: {
128+
'sentry.is_localhost': { value: false, type: 'boolean' },
127129
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: {
128130
type: 'string',
129131
value: 'manual',
@@ -168,6 +170,7 @@ sentryTest(
168170
},
169171
{
170172
attributes: {
173+
'sentry.is_localhost': { value: false, type: 'boolean' },
171174
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: {
172175
type: 'string',
173176
value: 'manual',
@@ -216,6 +219,7 @@ sentryTest(
216219
},
217220
{
218221
attributes: {
222+
'sentry.is_localhost': { value: false, type: 'boolean' },
219223
'culture.calendar': {
220224
type: 'string',
221225
value: expect.any(String),

‎dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/navigation-streamed/test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ sentryTest('starts a streamed navigation span on page navigation', async ({ brow
7777

7878
expect(navigationSpan).toEqual({
7979
attributes: {
80+
'sentry.is_localhost': { value: false, type: 'boolean' },
8081
[SENTRY_TRACE_LIFECYCLE]: {
8182
type: 'string',
8283
value: 'stream',

‎dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageload-streamed/test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ sentryTest(
7171

7272
expect(pageloadSpan).toEqual({
7373
attributes: {
74+
'sentry.is_localhost': { value: false, type: 'boolean' },
7475
'culture.calendar': {
7576
type: 'string',
7677
value: expect.any(String),

‎dev-packages/browser-integration-tests/suites/tracing/interactions/spans/test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ sentryTest('captures streamed interaction span tree. @firefox', async ({ browser
4646

4747
expect(interactionSegmentSpan).toEqual({
4848
attributes: {
49+
'sentry.is_localhost': { value: false, type: 'boolean' },
4950
[SENTRY_TRACE_LIFECYCLE]: {
5051
type: 'string',
5152
value: 'stream',
@@ -127,6 +128,7 @@ sentryTest('captures streamed interaction span tree. @firefox', async ({ browser
127128
const interactionSpan = interactionSpanTree.find(span => getSpanOp(span) === 'ui.interaction.click');
128129
expect(interactionSpan).toEqual({
129130
attributes: {
131+
'sentry.is_localhost': { value: false, type: 'boolean' },
130132
[SENTRY_TRACE_LIFECYCLE]: {
131133
type: 'string',
132134
value: 'stream',

‎dev-packages/browser-integration-tests/suites/tracing/is-localhost/init.js‎

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

55
Sentry.init({
66
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7-
integrations: [Sentry.browserTracingIntegration(), Sentry.spanStreamingIntegration()],
7+
integrations: [Sentry.browserTracingIntegration()],
88
tracesSampleRate: 1,
99
});

‎dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ sentryTest(
7373
is_segment: false,
7474
status: 'ok',
7575
attributes: {
76+
'sentry.is_localhost': { value: false, type: 'boolean' },
7677
'sentry.origin': { value: 'auto.http.browser.inp', type: 'string' },
7778
'sentry.op': { value: 'ui.interaction.click', type: 'string' },
7879
'sentry.exclusive_time': { value: inpValue, type: expect.stringMatching(/^(integer)|(double)$/) },

‎dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-navigate/test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ sentryTest(
7373
is_segment: false,
7474
status: 'ok',
7575
attributes: {
76+
'sentry.is_localhost': { value: false, type: 'boolean' },
7677
'sentry.origin': { value: 'auto.http.browser.inp', type: 'string' },
7778
'sentry.op': { value: 'ui.interaction.click', type: 'string' },
7879
'sentry.exclusive_time': { value: inpValue, type: expect.stringMatching(/^(integer)|(double)$/) },
@@ -159,6 +160,7 @@ sentryTest(
159160
is_segment: false,
160161
status: 'ok',
161162
attributes: {
163+
'sentry.is_localhost': { value: false, type: 'boolean' },
162164
'sentry.origin': { value: 'auto.http.browser.inp', type: 'string' },
163165
'sentry.op': { value: 'ui.interaction.click', type: 'string' },
164166
'sentry.exclusive_time': { value: inpValue, type: expect.stringMatching(/^(integer)|(double)$/) },

‎dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ sentryTest(
7474
is_segment: false,
7575
status: 'ok',
7676
attributes: {
77+
'sentry.is_localhost': { value: false, type: 'boolean' },
7778
'sentry.origin': { value: 'auto.http.browser.inp', type: 'string' },
7879
'sentry.op': { value: 'ui.interaction.click', type: 'string' },
7980
'sentry.exclusive_time': { value: inpValue, type: expect.stringMatching(/^(integer)|(double)$/) },

‎dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ sentryTest(
7474
is_segment: false,
7575
status: 'ok',
7676
attributes: {
77+
'sentry.is_localhost': { value: false, type: 'boolean' },
7778
'sentry.origin': { value: 'auto.http.browser.inp', type: 'string' },
7879
'sentry.op': { value: 'ui.interaction.click', type: 'string' },
7980
'sentry.exclusive_time': { value: inpValue, type: expect.stringMatching(/^(integer)|(double)$/) },

0 commit comments

Comments
 (0)