test: e2e Performance Regression Tracking#40518
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40518 +/- ##
========================================
Coverage 69.60% 69.60%
========================================
Files 3320 3321 +1
Lines 122512 122543 +31
Branches 21840 21816 -24
========================================
+ Hits 85273 85299 +26
- Misses 33910 33915 +5
Partials 3329 3329
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
Performance Regression Testing Infrastructure
A generic, opt-in fixture library for Playwright e2e tests. Import the extended
testobject and destructure only the fixtures you need — unused fixtures are never activated, and no existing tests are affected.Usage
Fixtures
cdpSessionPerformance.enable,Memory.prepareForLeakDetection, 4× CPU throttling (mid-range device simulation), and Fast 3G network conditions (offline: false)webVitalsPerformanceObserverinjected before the first byte loads; reads afterrequestIdleCallbackto ensure INP is fully capturedheapSnapshotdetectLeak()to assert heap growth stays within a threshold across N journey iterationslongTaskTrackernavigationIdto distinguish initial hydration from SPA route-change taskssoftNavTrackerinteraction-contentful-paintto "Soft LCP" per route viainteractionIdmatching; falls back silently on non-supporting buildslighthouseAuditget-port). CallnewPage()to authenticate, thenrunAudit(url). UsesdisableStorageReset: trueto preserve Playwright auth stateAll fixtures that depend on CDP (
heapSnapshot,longTaskTracker) automatically activatecdpSession.Baseline comparison
reporter/baseline.tsstores golden baselines inreporter/baselines/<suite>.jsonand diffs against them on each run.Adaptive thresholds
Thresholds are applied to the median across runs and scale automatically:
Failures include a
[View Trace](path)link for direct access to the Playwright Trace Viewer.Updating baselines
Run with
UPDATE_PERF_BASELINES=trueto overwrite the stored baseline after an intentional change:UPDATE_PERF_BASELINES=true npx playwright test --project=performanceCI sharding
When tests are sharded across runners, set
PERF_SHARD_RESULTS_DIRto a directory containing per-shard JSON artifacts.baseline.tswill merge them before computing the median.Playwright project
The
performanceproject inplaywright.config.tsruns alltests/e2e/performance/**/*.spec.tsfiles with:trace: on-first-retry— captures traces for failing tests without bloating artifacts--enable-experimental-web-platform-features— required for the Soft Navigation APIrepeatEach: 3in CI — enables statistically stable median calculationRun it with:
npx playwright test --project=performanceFile structure
Issue(s)
Steps to test or reproduce
Further comments