Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0815309
fix(nextjs): Await flush in api handlers (#14023)
chargome Oct 21, 2024
8b1f130
fix(solidstart): Use production server for e2e tests (#14033)
andreiborza Oct 21, 2024
7e39d04
Merge pull request #14036 from getsentry/master
github-actions[bot] Oct 21, 2024
022caf9
test(e2e): Create event dumps for all Next.js test apps (#14034)
Oct 22, 2024
6e2c0d1
fix(nuxt): Server-side setup in readme (#14049)
s1gr1d Oct 22, 2024
7b815bf
feat(nuxt): Add Sentry Pinia plugin (#14047)
s1gr1d Oct 22, 2024
5b22b26
fix(nextjs): Fix matching logic for file convention type for root lev…
Oct 22, 2024
d5756ea
deps: Bump bundler plugins and CLI to 2.22.6 and 2.37.0 respectively …
Oct 22, 2024
eb17d62
meta: Allow old Next.js version for dependency review (#14012)
mdtro Oct 22, 2024
6cee1bf
test(e2e): Add Next.js Turbopack E2E tests (#14031)
Oct 23, 2024
8a68fa9
fix(nuxt): Only wrap `.mjs` entry files in rollup (#14060)
s1gr1d Oct 23, 2024
c56d84d
test(node): Fix test runner (#14019)
timfish Oct 23, 2024
fe639f4
feat(nextjs/vercel-edge/cloudflare): Switch to OTEL for performance m…
Oct 24, 2024
e0820cf
fix(replay): Fix `onError` callback (#14002)
billyvg Oct 24, 2024
ff8e780
test(nextjs): Test for client trace propagation with Turbopack (#14059)
Oct 28, 2024
e68865a
fix(nextjs): Respect directives in value injection loader (#14083)
Oct 28, 2024
cc30c14
fix(core): Ensure standalone spans are not sent if SDK is disabled (#…
Lms24 Oct 28, 2024
974818a
chore(deps): bump rollup from 4.18.0 to 4.24.2 in /dev-packages/e2e-t…
dependabot[bot] Oct 28, 2024
765213b
ref: Remove overhead-metrics dev package (#14087)
mydea Oct 28, 2024
a70f797
ci: Update dependabot config (#14090)
mydea Oct 28, 2024
babfaed
chore(dev-deps): Bump rollup from 4.13.0 to 4.24.2 (#14093)
mydea Oct 28, 2024
e72d31d
feat(deps): bump @opentelemetry/instrumentation-fs from 0.15.0 to 0.1…
dependabot[bot] Oct 28, 2024
8e2d7d2
perf(otel): Only calculate current timestamp once (#14094)
AbhiPrasad Oct 28, 2024
5a2719b
feat(deps): bump @opentelemetry/instrumentation-express from 0.43.0 t…
dependabot[bot] Oct 28, 2024
bf1187e
ci(deps): bump denoland/setup-deno from 1.5.1 to 2.0.1 (#14096)
dependabot[bot] Oct 28, 2024
3dc4d08
feat(deps): bump @opentelemetry/instrumentation-aws-sdk from 0.44.0 t…
dependabot[bot] Oct 28, 2024
cfd411e
fix(profiling-node): Always warn when running on incompatible major v…
JonasBa Oct 28, 2024
5d2fc2c
feat(deps): bump @opentelemetry/instrumentation-kafkajs from 0.3.0 to…
dependabot[bot] Oct 28, 2024
dd0d7e0
feat(deps): bump @opentelemetry/instrumentation-connect from 0.39.0 t…
dependabot[bot] Oct 28, 2024
f32db11
chore(deps-dev): bump vite from 5.2.11 to 5.2.14 in /dev-packages/e2e…
dependabot[bot] Oct 28, 2024
d62a65c
meta: Bump E2E test timeouts (#14103)
Oct 28, 2024
6410841
chore(tests): Upgrade mysql2 package to 3.11.3 (#14105)
AbhiPrasad Oct 28, 2024
0982655
chore: Don't run dependabot on CodeQL PRs (#14109)
AbhiPrasad Oct 29, 2024
22c3865
chore: Unify nock versions (#14111)
AbhiPrasad Oct 29, 2024
c7378e6
fix(nuxt): Re-export all exported bindings (#14086)
s1gr1d Oct 29, 2024
9e676e0
test(browser-integration): Add sentry DSN route handler by default (#…
mydea Oct 29, 2024
a7193fb
ci: Use `list` reporter for playwright on CI instead of `line` (#14113)
mydea Oct 29, 2024
d396241
feat(node): Add breadcrumbs for `child_process` and `worker_thread` (…
timfish Oct 29, 2024
6fefd44
chore(dev-deps): Bump some (transitive) dev dependencies to latest (#…
mydea Oct 29, 2024
8f65bf7
ci: Fix CodeQL workflow config (#14117)
mydea Oct 29, 2024
f18d04f
chore(dev-deps): Bump size-limit to 11.1.6 (#14114)
mydea Oct 29, 2024
81b1f9f
ci(deps): bump github/codeql-action from 2 to 3 (#10004)
dependabot[bot] Oct 29, 2024
57ba5a7
fix(nextjs): Don't leak webpack types into exports (#14116)
Oct 29, 2024
06ef628
feat(nextjs): Add method and url to route handler request data (#14084)
onurtemizkan Oct 29, 2024
8d9322c
meta(changelog): Update changelog for 8.36.0
Oct 29, 2024
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
Prev Previous commit
Next Next commit
test(browser-integration): Add sentry DSN route handler by default (#…
…14095)

Instead of sprinkling this through tests, we can just generally handle
this route, streamlining tests a bit and avoid unexpected errors/console
warnings messing with things.

So this PR basically inverses this - by default, we add a "success"
route handler for the Sentry DSN, and if you want to have special
handling you can opt-out of this.

Supersedes
https://github.com/getsentry/sentry-javascript/pull/14092/files
  • Loading branch information
mydea authored Oct 29, 2024
commit 9e676e049dff53f7ff6f018bc9f1210ed587422a
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => {
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const req = waitForReplayRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ sentryTest('should capture a replay & attach an error', async ({ getLocalTestUrl
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const req = waitForReplayRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sentryTest('it does not download the SDK if the SDK was loaded in the meanwhile'
});
});

const tmpDir = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true });
const tmpDir = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true, skipDsnRouteHandler: true });

await page.route(`${TEST_HOST}/*.*`, route => {
const file = route.request().url().split('/').pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('captureException works inside of onLoad', async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForErrorRequestOnUrl(page, url);

Expand All @@ -21,14 +13,6 @@ sentryTest('captureException works inside of onLoad', async ({ getLocalTestUrl,
});

sentryTest('should set SENTRY_SDK_SOURCE value', async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForErrorRequestOnUrl(page, url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ const bundle = process.env.PW_BUNDLE || '';
const isLazy = LOADER_CONFIGS[bundle]?.lazy;

sentryTest('always calls onLoad init correctly', async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ sentryTest('should handle custom added integrations & default integrations', asy
const shouldHaveReplay = !shouldSkipReplayTest();
const shouldHaveBrowserTracing = !shouldSkipTracingTest();

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
sentryTest(
'should not add default integrations if integrations function is provided',
async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ sentryTest('should handle custom added Replay integration', async ({ getLocalTes
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const req = waitForReplayRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('keeps data on window.Sentry intact', async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForErrorRequestOnUrl(page, url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('late onLoad call is handled', async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForErrorRequestOnUrl(page, url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => {
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const req = waitForReplayRequest(page);

const url = await getLocalTestUrl({ testDir: __dirname });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr
}
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
}
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl
}
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await Promise.all([page.goto(url), page.getByText('Report a Bug').click(), reqPromise0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
}
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ sentryTest('should log error correctly', async ({ getLocalTestUrl, page }) => {
messages.push(message.text());
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ import { getMultipleSentryEnvelopeRequests } from '../../../utils/helpers';
sentryTest('it captures console messages correctly', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const [, events] = await Promise.all([page.goto(url), getMultipleSentryEnvelopeRequests<Event>(page, 7)]);

expect(events).toHaveLength(7);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import { sentryTest } from '../../../utils/fixtures';
sentryTest(
'should not initialize when inside a Firefox/Safari browser extension',
async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const errorLogs: string[] = [];

page.on('console', message => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ import { expect } from '@playwright/test';
import { sentryTest } from '../../../utils/fixtures';

sentryTest('should not initialize when inside a Chrome browser extension', async ({ getLocalTestUrl, page }) => {
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const errorLogs: string[] = [];

page.on('console', message => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sentryTest('exports shim metrics integration for non-tracing bundles', async ({
});
});

const url = await getLocalTestPath({ testDir: __dirname });
const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true });

await page.goto(url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ sentryTest('allows to wrap sync methods with a timing metric', async ({ getLocal
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

const beforeTime = Math.floor(Date.now() / 1000);
Expand Down Expand Up @@ -96,14 +88,6 @@ sentryTest('allows to wrap async methods with a timing metric', async ({ getLoca
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

const beforeTime = Math.floor(Date.now() / 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sentryTest(
});
});

const url = await getLocalTestPath({ testDir: __dirname });
const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true });

await page.goto(url);
await page.locator('#go-background').click();
Expand Down Expand Up @@ -190,7 +190,7 @@ sentryTest(
});
});

const url = await getLocalTestPath({ testDir: __dirname });
const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true });

await page.goto(url);
await page.locator('#go-background').click();
Expand Down Expand Up @@ -297,14 +297,6 @@ sentryTest(

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
Expand Down Expand Up @@ -359,14 +351,6 @@ sentryTest(

const reqPromise0 = waitForReplayRequest(page, 0);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

page.goto(url);
Expand Down Expand Up @@ -440,7 +424,7 @@ sentryTest(
});
});

const url = await getLocalTestPath({ testDir: __dirname });
const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true });

await page.goto(url);
// Start buffering and assert that it is enabled
Expand Down
Loading