Skip to content

Commit d02fd62

Browse files
committed
skip integration tests for cdn bundles
1 parent b4aa191 commit d02fd62

File tree

6 files changed

+27
-15
lines changed

6 files changed

+27
-15
lines changed

dev-packages/browser-integration-tests/suites/span-first/backgroundtab-pageload/test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { expect } from '@playwright/test';
22
import { sentryTest } from '../../../utils/fixtures';
3-
import { shouldSkipTracingTest } from '../../../utils/helpers';
3+
import { shouldSkipTracingTest, testingCdnBundle } from '../../../utils/helpers';
44
import { getSpanOp, waitForV2Spans } from '../../../utils/spanFirstUtils';
55

66
sentryTest('ends pageload span when the page goes to background', async ({ getLocalTestUrl, page }) => {
7-
if (shouldSkipTracingTest()) {
7+
// for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
8+
if (shouldSkipTracingTest() || testingCdnBundle()) {
89
sentryTest.skip();
910
}
11+
1012
const url = await getLocalTestUrl({ testDir: __dirname });
1113

1214
const spanPromise = waitForV2Spans(page, spans => !!spans.find(span => getSpanOp(span) === 'pageload'));

dev-packages/browser-integration-tests/suites/span-first/error/test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@ import {
55
envelopeRequestParser,
66
runScriptInSandbox,
77
shouldSkipTracingTest,
8+
testingCdnBundle,
89
waitForErrorRequest,
910
} from '../../../utils/helpers';
1011
import { getSpanOp, waitForV2Spans } from '../../../utils/spanFirstUtils';
1112

1213
sentryTest(
1314
'puts the pageload span name onto an error event caught during pageload',
1415
async ({ getLocalTestUrl, page, browserName }) => {
15-
if (browserName === 'webkit') {
16-
// This test fails on Webkit as errors thrown from `runScriptInSandbox` are Script Errors and skipped by Sentry
17-
sentryTest.skip();
18-
}
19-
20-
if (shouldSkipTracingTest()) {
16+
// for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
17+
// This test fails on Webkit as errors thrown from `runScriptInSandbox` are Script Errors and skipped by Sentry
18+
if (shouldSkipTracingTest() || testingCdnBundle() || browserName === 'webkit') {
2119
sentryTest.skip();
2220
}
2321

dev-packages/browser-integration-tests/suites/span-first/linked-traces/test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { expect } from '@playwright/test';
22
import { SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE } from '@sentry/core';
33
import { sentryTest } from '../../../utils/fixtures';
4-
import { shouldSkipTracingTest } from '../../../utils/helpers';
4+
import { shouldSkipTracingTest, testingCdnBundle } from '../../../utils/helpers';
55
import { getSpanOp, waitForV2Spans } from '../../../utils/spanFirstUtils';
66

77
sentryTest("navigation spans link back to previous trace's root span", async ({ getLocalTestUrl, page }) => {
8-
if (shouldSkipTracingTest()) {
8+
// for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
9+
if (shouldSkipTracingTest() || testingCdnBundle()) {
910
sentryTest.skip();
1011
}
1112

@@ -77,7 +78,8 @@ sentryTest("navigation spans link back to previous trace's root span", async ({
7778
});
7879

7980
sentryTest("doesn't link between hard page reloads by default", async ({ getLocalTestUrl, page }) => {
80-
if (shouldSkipTracingTest()) {
81+
// for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
82+
if (shouldSkipTracingTest() || testingCdnBundle()) {
8183
sentryTest.skip();
8284
}
8385

dev-packages/browser-integration-tests/suites/span-first/pageload/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { expect } from '@playwright/test';
22
import { sentryTest } from '../../../utils/fixtures';
3-
import { shouldSkipTracingTest } from '../../../utils/helpers';
3+
import { shouldSkipTracingTest, testingCdnBundle } from '../../../utils/helpers';
44
import { getSpanOp, waitForSpanV2Envelope } from '../../../utils/spanFirstUtils';
55

66
sentryTest('sends a span v2 envelope for the pageload', async ({ getLocalTestUrl, page }) => {
7-
if (shouldSkipTracingTest()) {
7+
// for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
8+
if (shouldSkipTracingTest() || testingCdnBundle()) {
89
sentryTest.skip();
910
}
1011

dev-packages/browser-integration-tests/suites/span-first/web-vitals/web-vitals-ttfb/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { expect } from '@playwright/test';
22
import { sentryTest } from '../../../../utils/fixtures';
3-
import { shouldSkipTracingTest } from '../../../../utils/helpers';
3+
import { shouldSkipTracingTest, testingCdnBundle } from '../../../../utils/helpers';
44
import { getSpanOp, waitForV2Spans } from '../../../../utils/spanFirstUtils';
55

66
sentryTest('captures TTFB web vital', async ({ getLocalTestUrl, page }) => {
7-
if (shouldSkipTracingTest()) {
7+
// for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
8+
if (shouldSkipTracingTest() || testingCdnBundle()) {
89
sentryTest.skip();
910
}
1011
const pageloadSpansPromise = waitForV2Spans(page, spans => !!spans.find(span => getSpanOp(span) === 'pageload'));

dev-packages/browser-integration-tests/utils/helpers.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ export function shouldSkipTracingTest(): boolean {
314314
return bundle != null && !bundle.includes('tracing') && !bundle.includes('esm') && !bundle.includes('cjs');
315315
}
316316

317+
/**
318+
* @returns `true` if we are testing a CDN bundle
319+
*/
320+
export function testingCdnBundle(): boolean {
321+
const bundle = process.env.PW_BUNDLE;
322+
return bundle != null;
323+
}
324+
317325
/**
318326
* Today we always run feedback tests, but this can be used to guard this if we ever need to.
319327
*/

0 commit comments

Comments
 (0)