Skip to content

Commit 62896cc

Browse files
HazATclaude
andcommitted
revert(e2e-tests): restore original test apps and build.yml
Addresses Francesco's review feedback on PR #20850: - Comment #1: remove the unrelated `types: [opened, synchronize, reopened]` line added under `pull_request:` in build.yml — develop has bare `pull_request:` with no types filter. - Comment #4 (revert half): drop SENTRY_LIGHTHOUSE_MODE instrumentation from the three existing e2e apps (default-browser, nextjs-16, react-19) and restore default-browser/build.mjs to its original EnvironmentPlugin call with only E2E_TEST_DSN. The Lighthouse instrumentation previously spread across these apps will be replaced by a dedicated `lighthouse-react` fixture in the follow-up commit, keeping the existing e2e apps clean and unmodified from their develop state. Co-Authored-By: claude-sonnet-4-5 <noreply@anthropic.com>
1 parent 9ba92f4 commit 62896cc

5 files changed

Lines changed: 57 additions & 143 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- v8
99
- release/**
1010
pull_request:
11-
types: [opened, synchronize, reopened]
1211
merge_group:
1312
types: [checks_requested]
1413
workflow_dispatch:
@@ -503,6 +502,8 @@ jobs:
503502
node-version-file: 'package.json'
504503
- name: Set up Bun
505504
uses: oven-sh/setup-bun@v2
505+
with:
506+
bun-version: '1.3.14'
506507
- name: Restore caches
507508
uses: ./.github/actions/restore-cache
508509
with:
@@ -885,6 +886,8 @@ jobs:
885886
node-version-file: 'package.json'
886887
- name: Set up Bun
887888
uses: oven-sh/setup-bun@v2
889+
with:
890+
bun-version: '1.3.14'
888891
- name: Restore caches
889892
uses: ./.github/actions/restore-cache
890893
with:
@@ -926,9 +929,8 @@ jobs:
926929
- name: Run integration tests
927930
env:
928931
NODE_VERSION: ${{ matrix.node }}
929-
run: |
930-
cd packages/remix
931-
yarn test:integration:ci
932+
working-directory: packages/remix
933+
run: yarn test:integration
932934

933935
job_build_tarballs:
934936
name: Build tarballs
@@ -1013,6 +1015,8 @@ jobs:
10131015
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4"]'),
10141016
matrix.test-application)
10151017
uses: oven-sh/setup-bun@v2
1018+
with:
1019+
bun-version: '1.3.14'
10161020
- name: Set up AWS SAM
10171021
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
10181022
uses: aws-actions/setup-sam@v2

dev-packages/e2e-tests/test-applications/default-browser/build.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,8 @@ webpack(
1717
minimize: true,
1818
minimizer: [new TerserPlugin()],
1919
},
20-
// The Lighthouse-CI baseline mode (SENTRY_LIGHTHOUSE_MODE=no-sentry) emits the
21-
// @sentry/browser chunk as a separately code-split asset (~265 KiB raw). Webpack's
22-
// default performance.hints='warning' fires AssetsOverSizeLimitWarning for that
23-
// chunk, and build.mjs's `if (stats.hasWarnings()) process.exit(1)` would then
24-
// abort the build. This is a test app, not a size-tracked production bundle, so
25-
// hints are disabled — size is tracked separately via .size-limit.js at the repo root.
26-
performance: { hints: false },
2720
plugins: [
28-
new webpack.EnvironmentPlugin({ E2E_TEST_DSN: '', SENTRY_LIGHTHOUSE_MODE: '' }),
21+
new webpack.EnvironmentPlugin(['E2E_TEST_DSN']),
2922
new HtmlWebpackPlugin({
3023
template: path.join(__dirname, 'public/index.html'),
3124
}),
Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,18 @@
1-
const lighthouseMode = process.env.SENTRY_LIGHTHOUSE_MODE;
1+
import * as Sentry from '@sentry/browser';
2+
3+
Sentry.init({
4+
dsn: process.env.E2E_TEST_DSN,
5+
integrations: [Sentry.browserTracingIntegration()],
6+
tracesSampleRate: 1.0,
7+
release: 'e2e-test',
8+
environment: 'qa',
9+
tunnel: 'http://localhost:3031',
10+
});
211

3-
// Event listeners are attached synchronously at module top-level so E2E tests that do
4-
// `page.goto('/')` followed immediately by `button.click()` cannot race the dynamic
5-
// `import('@sentry/browser')` below. The handlers don't depend on Sentry being
6-
// initialized — Sentry's global error/transaction handlers attach via window-level
7-
// listeners installed by `Sentry.init()` and pick up the thrown error regardless.
812
document.getElementById('exception-button').addEventListener('click', () => {
913
throw new Error('I am an error!');
1014
});
1115

1216
document.getElementById('navigation-link').addEventListener('click', () => {
1317
document.getElementById('navigation-target').scrollIntoView({ behavior: 'smooth' });
1418
});
15-
16-
// Sentry is loaded via dynamic `import()` so the `no-sentry` Lighthouse build can
17-
// tree-shake the SDK out completely. Wrapped in an async IIFE because top-level await
18-
// isn't supported by the webpack target used for this app's bundle.
19-
if (lighthouseMode !== 'no-sentry') {
20-
void (async () => {
21-
const Sentry = await import('@sentry/browser');
22-
23-
const integrations = [];
24-
25-
// Existing E2E behavior (empty string) and 'tracing-replay' mode both include tracing.
26-
// 'init-only' mode omits all integrations so we can measure SDK-core overhead.
27-
if (lighthouseMode !== 'init-only') {
28-
integrations.push(Sentry.browserTracingIntegration());
29-
}
30-
31-
// Replay is gated to 'tracing-replay' so we can measure its overhead independently
32-
// from tracing. Existing E2E behavior (unset env var) did not include replay, so we
33-
// preserve that.
34-
if (lighthouseMode === 'tracing-replay') {
35-
integrations.push(Sentry.replayIntegration());
36-
}
37-
38-
Sentry.init({
39-
dsn: process.env.E2E_TEST_DSN,
40-
integrations,
41-
tracesSampleRate: 1.0,
42-
replaysSessionSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : 0,
43-
replaysOnErrorSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : 0,
44-
release: 'e2e-test',
45-
environment: 'qa',
46-
tunnel: 'http://localhost:3031',
47-
});
48-
})();
49-
}
Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,22 @@
11
import * as Sentry from '@sentry/nextjs';
22
import type { Log } from '@sentry/nextjs';
33

4-
// SENTRY_LIGHTHOUSE_MODE values:
5-
// ''/undefined - existing E2E behavior (no tracing/replay; third-party-error-filter on)
6-
// 'no-sentry' - Sentry.init() is skipped entirely (SDK is still in the bundle because
7-
// Next.js doesn't reliably treeshake @sentry/nextjs; see plan Risk 5)
8-
// 'init-only' - Sentry.init() with no integrations (measures SDK-core overhead)
9-
// 'tracing-replay' - Sentry.init() with browserTracing + replay (measures feature overhead)
10-
const lighthouseMode = process.env.NEXT_PUBLIC_SENTRY_LIGHTHOUSE_MODE;
4+
Sentry.init({
5+
environment: 'qa', // dynamic sampling bias to keep transactions
6+
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
7+
tunnel: `http://localhost:3031/`, // proxy server
8+
tracesSampleRate: 1.0,
9+
sendDefaultPii: true,
10+
integrations: [
11+
Sentry.thirdPartyErrorFilterIntegration({
12+
filterKeys: ['nextjs-16-e2e'],
13+
behaviour: 'apply-tag-if-contains-third-party-frames',
14+
}),
15+
],
16+
// Verify Log type is available
17+
beforeSendLog(log: Log) {
18+
return log;
19+
},
20+
});
1121

12-
if (lighthouseMode !== 'no-sentry') {
13-
Sentry.init({
14-
environment: 'qa', // dynamic sampling bias to keep transactions
15-
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
16-
tunnel: `http://localhost:3031/`, // proxy server
17-
tracesSampleRate: 1.0,
18-
replaysSessionSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : 0,
19-
replaysOnErrorSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : 0,
20-
sendDefaultPii: true,
21-
// Existing E2E behavior (mode unset/'') keeps third-party-error-filter on.
22-
// init-only / tracing-replay drop it so we measure SDK overhead without app-specific noise.
23-
// tracing-replay additionally enables browserTracing + replay.
24-
integrations: [
25-
...(lighthouseMode === undefined || lighthouseMode === ''
26-
? [
27-
Sentry.thirdPartyErrorFilterIntegration({
28-
filterKeys: ['nextjs-16-e2e'],
29-
behaviour: 'apply-tag-if-contains-third-party-frames',
30-
}),
31-
]
32-
: []),
33-
...(lighthouseMode === 'tracing-replay' ? [Sentry.browserTracingIntegration(), Sentry.replayIntegration()] : []),
34-
],
35-
// Verify Log type is available
36-
beforeSendLog(log: Log) {
37-
return log;
38-
},
39-
});
40-
}
41-
42-
export const onRouterTransitionStart = lighthouseMode !== 'no-sentry' ? Sentry.captureRouterTransitionStart : undefined;
22+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
Lines changed: 20 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,26 @@
1+
import * as Sentry from '@sentry/react';
12
import React from 'react';
23
import ReactDOM from 'react-dom/client';
34
import Index from './pages/Index';
45

5-
const lighthouseMode = process.env.REACT_APP_SENTRY_LIGHTHOUSE_MODE;
6+
Sentry.init({
7+
environment: 'qa', // dynamic sampling bias to keep transactions
8+
dsn: process.env.REACT_APP_E2E_TEST_DSN,
9+
release: 'e2e-test',
10+
tunnel: 'http://localhost:3031/', // proxy server
11+
});
612

7-
if (lighthouseMode === 'no-sentry') {
8-
// No Sentry at all — sync render so webpack/CRA can fully dead-code-eliminate the
9-
// @sentry/react import below. CRA inlines `process.env.REACT_APP_*` at build time,
10-
// so this branch becomes the only one in the bundle when the env var is set.
11-
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
12-
root.render(
13-
<div>
14-
<Index />
15-
</div>,
16-
);
17-
} else {
18-
// Dynamic-import Sentry so it lives in a separate chunk that webpack/CRA drops
19-
// entirely from the no-sentry build above. Preserves existing E2E behavior when
20-
// the env var is unset (init + error handlers, no tracing/replay).
21-
void (async () => {
22-
const Sentry = await import('@sentry/react');
13+
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement, {
14+
onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
15+
console.warn(error, errorInfo);
16+
}),
17+
onCaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
18+
console.warn(error, errorInfo);
19+
}),
20+
});
2321

24-
const integrations: unknown[] = [];
25-
if (lighthouseMode === 'tracing-replay') {
26-
integrations.push(Sentry.browserTracingIntegration());
27-
integrations.push(Sentry.replayIntegration());
28-
}
29-
30-
Sentry.init({
31-
environment: 'qa', // dynamic sampling bias to keep transactions
32-
dsn: process.env.REACT_APP_E2E_TEST_DSN,
33-
release: 'e2e-test',
34-
tunnel: 'http://localhost:3031/', // proxy server
35-
integrations: integrations as Parameters<typeof Sentry.init>[0]['integrations'],
36-
tracesSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : undefined,
37-
replaysSessionSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : 0,
38-
replaysOnErrorSampleRate: lighthouseMode === 'tracing-replay' ? 1.0 : 0,
39-
});
40-
41-
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement, {
42-
onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
43-
// oxlint-disable-next-line no-console
44-
console.warn(error, errorInfo);
45-
}),
46-
onCaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
47-
// oxlint-disable-next-line no-console
48-
console.warn(error, errorInfo);
49-
}),
50-
});
51-
52-
root.render(
53-
<div>
54-
<Index />
55-
</div>,
56-
);
57-
})();
58-
}
22+
root.render(
23+
<div>
24+
<Index />
25+
</div>,
26+
);

0 commit comments

Comments
 (0)