-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ci: Add Lighthouse Test as Nightly CI run #20850
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
Open
HazAT
wants to merge
36
commits into
develop
Choose a base branch
from
feat/lighthouse-ci
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
d496226
feat(lighthouse-ci): scaffold lighthouse-tests dev-package
HazAT 36c3f76
feat(lighthouse-ci): add SENTRY_LIGHTHOUSE_MODE guard to default-brow…
HazAT cc37d4d
fix(lighthouse-ci): enable replay in tracing-replay mode for default-…
HazAT ae9b8b8
feat(lighthouse-ci): add nightly + label-gated lighthouse jobs to bui…
HazAT 2a7c378
fix(lighthouse-ci): align workflow with actual matrix schema and ligh…
HazAT 0119764
feat(lighthouse-ci): add post-comment.mjs to render Lighthouse result…
HazAT cfa2092
fix(lighthouse-ci): drop unusable local-path links from PR comment
HazAT e8cb7f8
chore(lighthouse-ci): pin treosh/lighthouse-ci-action to commit SHA
HazAT e04bc37
fix(lighthouse-ci): unblock webpack build and surface LCP/TBT/bytes i…
HazAT 9e28f29
chore(lighthouse-ci): drop angular, remix, ember, solidstart from matrix
HazAT 254f973
fix(lighthouse-ci): rename lighthouserc.js to .cjs and switch to modu…
HazAT b766f80
fix(lighthouse-ci): drop redundant uploadArtifacts from treosh action
HazAT db8a4bb
fix(lighthouse-ci): unblock nextjs-16 + astro-5; drop react-router-7-spa
HazAT b29aada
fix(lighthouse-ci): upload artifacts from the treosh action's results…
HazAT b96bb65
fix(lighthouse-ci): include hidden files when uploading .lighthouseci…
HazAT 9809ea1
fix(lighthouse-ci): attach default-browser listeners synchronously to…
HazAT 1549ea8
chore(lighthouse-ci): trim matrix to instrumented apps only (default-…
HazAT 760b128
fix(lighthouse-ci): run on every PR + nightly, drop label gate
HazAT 8288dcb
feat(lighthouse-ci): render report as Job Summary; sync APPS list to …
HazAT 7c24cff
chore(lighthouse-ci): extract to standalone nightly workflow
HazAT 06f87a5
refactor(lighthouse-ci): drop PR-commenting logic from report script
HazAT bb5ee63
feat(react-19-e2e): add SENTRY_LIGHTHOUSE_MODE instrumentation
HazAT df529c5
feat(lighthouse-ci): bundle test apps and upload to lighthouse.sentry…
HazAT d876721
ci(lighthouse): TEMP — fire workflow on push to feat/lighthouse-ci
HazAT a271b87
fix(lighthouse-ci): update root workspaces to lighthouse-bundle
HazAT 1800bf0
fix(lighthouse-ci): upload build-output artifact for restore-cache
HazAT 48c2db9
refactor(lighthouse-ci): fire-and-forget upload, fix SSR install, har…
HazAT cad23e0
revert(react-router-7-spa-e2e): restore original entry, drop dead lig…
HazAT 9ba92f4
ci(lighthouse): drop temp push trigger on feat/lighthouse-ci
HazAT 62896cc
revert(e2e-tests): restore original test apps and build.yml
HazAT ca35738
feat(e2e-tests): add lighthouse-react fixture with 3 Sentry modes
HazAT 12ab6e8
feat(lighthouse-ci): bundle script targets new single-app static matrix
HazAT 8113edd
ci(lighthouse): collapse to single job, drop artifact round-trip
HazAT 86cfe88
fix(lighthouse-ci): restore CACHED_DEPENDENCY_PATHS for install-depen…
HazAT 6015961
ci(lighthouse): drop concurrency block and dependency caching
HazAT e0f112e
ci(lighthouse): move upload script into root scripts/ folder
HazAT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: 'Nightly: Lighthouse' | ||
|
|
||
| # Nightly: builds the Lighthouse fixture app and uploads bundles to the | ||
| # lighthouse.sentry.gg lab. Never blocks merges. | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 0 * * *' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-and-upload: | ||
| name: Bundle and upload Lighthouse cells | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
| env: | ||
| LIGHTHOUSE_LAB_URL: ${{ secrets.LIGHTHOUSE_LAB_URL }} | ||
| LIGHTHOUSE_UPLOAD_TOKEN: ${{ secrets.LIGHTHOUSE_UPLOAD_TOKEN }} | ||
| VITE_E2E_TEST_DSN: 'https://username@domain/123' | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | ||
| with: | ||
| version: 9.15.9 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: 'package.json' | ||
| - run: yarn install --frozen-lockfile --ignore-engines | ||
| - run: yarn build:ci | ||
| - run: yarn build:tarball | ||
| - run: yarn test:prepare | ||
| working-directory: dev-packages/e2e-tests | ||
| - run: node scripts/lighthouse-bundle-and-upload.mjs |
13 changes: 13 additions & 0 deletions
13
dev-packages/e2e-tests/test-applications/lighthouse-react/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/logo.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Lighthouse Fixture</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
32 changes: 32 additions & 0 deletions
32
dev-packages/e2e-tests/test-applications/lighthouse-react/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "name": "lighthouse-react-test-app", | ||
| "private": true, | ||
| "type": "module", | ||
| "sentryTest": { | ||
| "skip": true | ||
| }, | ||
| "scripts": { | ||
| "build": "vite build", | ||
| "build:no-sentry": "vite build --mode no-sentry", | ||
| "build:init-only": "vite build --mode init-only", | ||
| "build:tracing-replay": "vite build --mode tracing-replay", | ||
| "preview": "vite preview", | ||
| "clean": "npx rimraf node_modules pnpm-lock.yaml dist", | ||
| "test:build": "pnpm install && pnpm build" | ||
| }, | ||
| "dependencies": { | ||
| "@sentry/react": "file:../../packed/sentry-react-packed.tgz", | ||
| "react": "^18.3.1", | ||
| "react-dom": "^18.3.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^18.3.0", | ||
| "@types/react-dom": "^18.3.0", | ||
| "@vitejs/plugin-react-swc": "^3.7.0", | ||
| "typescript": "~5.4.0", | ||
| "vite": "^5.4.0" | ||
| }, | ||
| "volta": { | ||
| "extends": "../../package.json" | ||
| } | ||
| } | ||
6 changes: 6 additions & 0 deletions
6
dev-packages/e2e-tests/test-applications/lighthouse-react/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions
60
dev-packages/e2e-tests/test-applications/lighthouse-react/src/App.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { useEffect, useState } from 'react'; | ||
|
|
||
| const CARDS = [ | ||
| { title: 'Performance', body: 'Measure and optimize your app render times and interaction latency.' }, | ||
| { title: 'Accessibility', body: 'Ensure your interface is usable by everyone, including assistive technologies.' }, | ||
| { title: 'Best Practices', body: 'Follow modern web development patterns for secure and maintainable code.' }, | ||
| { title: 'SEO', body: 'Optimize discoverability with semantic markup and structured metadata.' }, | ||
| { title: 'PWA', body: 'Add offline support and installability via service workers and manifests.' }, | ||
| { title: 'Security', body: 'Protect users with CSP headers, HTTPS, and input validation.' }, | ||
| ]; | ||
|
|
||
| export default function App() { | ||
| const [count, setCount] = useState(0); | ||
|
|
||
| useEffect(() => { | ||
| document.title = `Lighthouse Fixture (${count})`; | ||
| }, [count]); | ||
|
|
||
| return ( | ||
| <main> | ||
| <header> | ||
| <nav> | ||
| <a href="/">Home</a> | ||
| <a href="/docs">Docs</a> | ||
| <a href="/about">About</a> | ||
| </nav> | ||
| </header> | ||
|
|
||
| <section className="hero"> | ||
| <img src="/logo.svg" alt="Lighthouse logo" width={120} height={120} /> | ||
| <h1>Lighthouse Fixture</h1> | ||
| <p> | ||
| This app exists to measure JavaScript bundle size and runtime cost across three Sentry instrumentation | ||
| configurations. Each build mode ships a different level of SDK integration. | ||
| </p> | ||
| </section> | ||
|
|
||
| <section className="cards"> | ||
| {CARDS.map(card => ( | ||
| <article key={card.title} className="card"> | ||
| <h2>{card.title}</h2> | ||
| <p>{card.body}</p> | ||
| </article> | ||
| ))} | ||
| </section> | ||
|
|
||
| <form | ||
| onSubmit={e => { | ||
| e.preventDefault(); | ||
| setCount(c => c + 1); | ||
| }} | ||
| > | ||
| <input type="text" name="name" placeholder="Name" aria-label="Name" /> | ||
| <input type="email" name="email" placeholder="Email" aria-label="Email" /> | ||
| <input type="text" name="message" placeholder="Message" aria-label="Message" /> | ||
| <button type="submit">Submit ({count})</button> | ||
| </form> | ||
| </main> | ||
| ); | ||
| } |
20 changes: 20 additions & 0 deletions
20
dev-packages/e2e-tests/test-applications/lighthouse-react/src/main.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { createRoot } from 'react-dom/client'; | ||
| import App from './App'; | ||
|
|
||
| async function bootstrap() { | ||
| const mode = import.meta.env.MODE; | ||
| if (mode === 'init-only') { | ||
| const { initSentry } = await import('./sentry/init-only'); | ||
| initSentry(); | ||
| } else if (mode === 'tracing-replay') { | ||
| const { initSentry } = await import('./sentry/tracing-replay'); | ||
| initSentry(); | ||
| } | ||
| // 'no-sentry' mode: do not import any sentry module — the dynamic-import | ||
| // branches above are unreachable and Vite drops them from the bundle. | ||
|
|
||
| const root = createRoot(document.getElementById('root')!); | ||
| root.render(<App />); | ||
| } | ||
|
|
||
| void bootstrap(); |
7 changes: 7 additions & 0 deletions
7
dev-packages/e2e-tests/test-applications/lighthouse-react/src/sentry/init-only.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import * as Sentry from '@sentry/react'; | ||
|
|
||
| export function initSentry(): void { | ||
| // enabled: false makes the SDK a guaranteed no-op (no transport allocation, | ||
| // no DSN warning). We're measuring pure SDK-loading + tree-shaking cost. | ||
| Sentry.init({ enabled: false }); | ||
| } |
3 changes: 3 additions & 0 deletions
3
dev-packages/e2e-tests/test-applications/lighthouse-react/src/sentry/no-sentry.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function initSentry(): void { | ||
| // no-op: this mode intentionally excludes all Sentry imports | ||
| } | ||
|
HazAT marked this conversation as resolved.
|
||
13 changes: 13 additions & 0 deletions
13
dev-packages/e2e-tests/test-applications/lighthouse-react/src/sentry/tracing-replay.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import * as Sentry from '@sentry/react'; | ||
|
|
||
| export function initSentry(): void { | ||
| Sentry.init({ | ||
| dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined, | ||
| release: 'lighthouse-fixture', | ||
| environment: 'qa', | ||
| integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()], | ||
| tracesSampleRate: 1.0, | ||
| replaysSessionSampleRate: 1.0, | ||
| replaysOnErrorSampleRate: 1.0, | ||
| }); | ||
| } |
21 changes: 21 additions & 0 deletions
21
dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2020", | ||
| "useDefineForClassFields": true, | ||
| "lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
| "module": "ESNext", | ||
| "skipLibCheck": true, | ||
| "moduleResolution": "bundler", | ||
| "allowImportingTsExtensions": true, | ||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "noEmit": true, | ||
| "jsx": "react-jsx", | ||
| "strict": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "noFallthroughCasesInSwitch": true | ||
| }, | ||
| "include": ["src"], | ||
| "references": [{ "path": "./tsconfig.node.json" }] | ||
| } |
10 changes: 10 additions & 0 deletions
10
dev-packages/e2e-tests/test-applications/lighthouse-react/tsconfig.node.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "composite": true, | ||
| "skipLibCheck": true, | ||
| "module": "ESNext", | ||
| "moduleResolution": "bundler", | ||
| "allowSyntheticDefaultImports": true | ||
| }, | ||
| "include": ["vite.config.ts"] | ||
| } |
6 changes: 6 additions & 0 deletions
6
dev-packages/e2e-tests/test-applications/lighthouse-react/vite.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react-swc'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [react()], | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably can skip this in regular e2e test runs!