LibreChat/e2e/lighthouse/budgets.mts
Danny Avila 445668a371
🧭 ci: Assert Lighthouse Blocking Time at a Reference CPU on the Quietest Run (#18406)
Total blocking time is CPU time, and the hosted runner's CPU is not a constant: Lighthouse's
own benchmark of the runner moves by more than 2x between consecutive runs of one build on a
two-core runner, and blocking time moves with it. A median of three raw measurements against
a fixed budget therefore fails on the runner rather than on the page.

Rescale each run's main-thread tasks by that run's benchmark index to a reference CPU, assert
the lowest run instead of the median, and measure an over-budget batch once more before
failing. Budgets move to their own file so a fork with a heavier client changes numbers only.
2026-11-18 07:47:01 -05:00

12 lines
420 B
TypeScript

/** Budgets keyed by Lighthouse audit id. */
export type Budgets = Record<string, number>;
/**
* The numbers live apart from the runner so a fork that ships a heavier client changes this
* file alone. `total-blocking-time` is asserted at the reference CPU: see `measure.mts`.
*/
export const BUDGETS: Budgets = {
'largest-contentful-paint': 4500,
'cumulative-layout-shift': 0.1,
'total-blocking-time': 500,
};