Skip to content

Commit 7cc4ba8

Browse files
authored
feat: upgrade to lighthouse 11.4.0 (#991)
BREAKING CHANGE: upgrade to lighthouse 11.4.0
1 parent 3ea9955 commit 7cc4ba8

18 files changed

+80120
-173
lines changed

packages/cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"https-proxy-agent": "^5.0.0",
2222
"inquirer": "^6.3.1",
2323
"isomorphic-fetch": "^3.0.0",
24-
"lighthouse": "10.1.0",
24+
"lighthouse": "11.4.0",
2525
"lighthouse-logger": "1.2.0",
2626
"open": "^7.1.0",
2727
"tmp": "^0.1.0",

packages/cli/test/assert.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('Lighthouse CI assert CLI', () => {
5555
it('should run the recommended preset', async () => {
5656
const result = await run([`--preset=lighthouse:recommended`]);
5757
expect(result.status).toEqual(1);
58-
expect(result.failures.length).toMatchInlineSnapshot(`98`);
58+
expect(result.failures.length).toMatchInlineSnapshot(`115`);
5959
expect(result.warnings.length).toMatchInlineSnapshot(`17`);
6060
expect(result.passes.length).toMatchInlineSnapshot(`0`);
6161
expect(result.failures).toContain('deprecations failure');
@@ -65,7 +65,7 @@ describe('Lighthouse CI assert CLI', () => {
6565
it('should run the no-pwa preset', async () => {
6666
const result = await run([`--preset=lighthouse:no-pwa`]);
6767
expect(result.status).toEqual(1);
68-
expect(result.failures.length).toMatchInlineSnapshot(`91`);
68+
expect(result.failures.length).toMatchInlineSnapshot(`109`);
6969
expect(result.warnings.length).toMatchInlineSnapshot(`16`);
7070
expect(result.passes.length).toMatchInlineSnapshot(`0`);
7171
expect(result.failures).toContain('deprecations failure');
@@ -92,7 +92,7 @@ describe('Lighthouse CI assert CLI', () => {
9292
const result = await run([`--preset=lighthouse:recommended`, '--include-passed-assertions']);
9393
expect(result.status).toEqual(1);
9494
expect(result.warnings.length).toMatchInlineSnapshot(`17`);
95-
expect(result.failures.length).toMatchInlineSnapshot(`98`);
95+
expect(result.failures.length).toMatchInlineSnapshot(`115`);
9696
expect(result.passes.length).toMatchInlineSnapshot(`1`);
9797
expect(result.passes).toContain('first-contentful-paint passing');
9898
expect(result.failures).toContain('viewport failure');

packages/cli/test/cli.test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,7 @@ describe('Lighthouse CI CLI', () => {
440440
1 result(s) for http://localhost:XXXX/app/ :
441441
442442
X resource-summary.script.size failure for maxNumericValue assertion
443-
Keep request counts low and transfer sizes small
444-
https://web.dev/use-lighthouse-for-performance-budgets/
443+
Resources Summary
445444
446445
expected: <=XXXX
447446
found: XXXX

packages/server/src/ui/routes/build-view/audit-detail/audit-detail-pane.stories.jsx

+14
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import lhr930A_ from '../../../../../test/fixtures/lh-9-3-0-coursehero-a.json';
2424
import lhr930B_ from '../../../../../test/fixtures/lh-9-3-0-coursehero-b.json';
2525
import lhr1010A_ from '../../../../../test/fixtures/lh-10-1-0-coursehero-a.json';
2626
import lhr1010B_ from '../../../../../test/fixtures/lh-10-1-0-coursehero-b.json';
27+
import lhr1140A_ from '../../../../../test/fixtures/lh-11-4-0-coursehero-a.json';
28+
import lhr1140B_ from '../../../../../test/fixtures/lh-11-4-0-coursehero-b.json';
2729
import lhrSubitemsA_ from '../../../../../test/fixtures/lh-subitems-a.json';
2830
import lhrSubitemsB_ from '../../../../../test/fixtures/lh-subitems-b.json';
2931
import lhrPsi800A_ from '../../../../../test/fixtures/psi-8-0-0-dkdev-a.json';
@@ -50,6 +52,8 @@ const lhr930A = /** @type {any} */ (lhr930A_);
5052
const lhr930B = /** @type {any} */ (lhr930B_);
5153
const lhr1010A = /** @type {any} */ (lhr1010A_);
5254
const lhr1010B = /** @type {any} */ (lhr1010B_);
55+
const lhr1140A = /** @type {any} */ (lhr1140A_);
56+
const lhr1140B = /** @type {any} */ (lhr1140B_);
5357
const lhrSubitemsA = /** @type {any} */ (lhrSubitemsA_);
5458
const lhrSubitemsB = /** @type {any} */ (lhrSubitemsB_);
5559
const lhrPsi800A = /** @type {any} */ (lhrPsi800A_);
@@ -63,6 +67,7 @@ const auditPairs700 = createAuditPairs(lhr700A, lhr700B);
6367
const auditPairs800 = createAuditPairs(lhr800A, lhr800B);
6468
const auditPairs930 = createAuditPairs(lhr930A, lhr930B);
6569
const auditPairs1010 = createAuditPairs(lhr1010A, lhr1010B);
70+
const auditPairs1140 = createAuditPairs(lhr1140A, lhr1140B);
6671
const auditPairsPsi800 = createAuditPairs(lhrPsi800A, lhrPsi800B);
6772
const auditPairsSubitems = createAuditPairs(lhrSubitemsA, lhrSubitemsB, {
6873
filter: pair =>
@@ -147,6 +152,15 @@ export const Version1010 = () => (
147152
/>
148153
);
149154

155+
export const Version1140 = () => (
156+
<AuditDetailPane
157+
selectedAuditId={auditPairs1140[1].audit.id || ''}
158+
setSelectedAuditId={action('setSelectedAuditId')}
159+
pairs={auditPairs1140}
160+
baseLhr={lhr1140B}
161+
/>
162+
);
163+
150164
export const VersionPsi800 = () => (
151165
<AuditDetailPane
152166
selectedAuditId={auditPairsPsi800[1].audit.id || ''}

packages/server/src/ui/routes/build-view/lhr-comparison.stories.jsx

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import lhr930A_ from '../../../../test/fixtures/lh-9-3-0-coursehero-a.json';
2222
import lhr930B_ from '../../../../test/fixtures/lh-9-3-0-coursehero-b.json';
2323
import lhr1010A_ from '../../../../test/fixtures/lh-10-1-0-coursehero-a.json';
2424
import lhr1010B_ from '../../../../test/fixtures/lh-10-1-0-coursehero-b.json';
25+
import lhr1140A_ from '../../../../test/fixtures/lh-11-4-0-coursehero-a.json';
26+
import lhr1140B_ from '../../../../test/fixtures/lh-11-4-0-coursehero-b.json';
2527
import lhrPsi800A_ from '../../../../test/fixtures/psi-8-0-0-dkdev-a.json';
2628
import lhrPsi800B_ from '../../../../test/fixtures/psi-8-0-0-dkdev-b.json';
2729

@@ -46,6 +48,8 @@ const lhr930A = /** @type {any} */ (lhr930A_);
4648
const lhr930B = /** @type {any} */ (lhr930B_);
4749
const lhr1010A = /** @type {any} */ (lhr1010A_);
4850
const lhr1010B = /** @type {any} */ (lhr1010B_);
51+
const lhr1140A = /** @type {any} */ (lhr1140A_);
52+
const lhr1140B = /** @type {any} */ (lhr1140B_);
4953
const lhrPsi800A = /** @type {any} */ (lhrPsi800A_);
5054
const lhrPsi800B = /** @type {any} */ (lhrPsi800B_);
5155

@@ -100,6 +104,12 @@ export const Version1010 = () => (
100104
</Wrapper>
101105
);
102106

107+
export const Version1140 = () => (
108+
<Wrapper>
109+
<LhrComparison lhr={lhr1140A} baseLhr={lhr1140B} hookElements={{}} />
110+
</Wrapper>
111+
);
112+
103113
export const VersionPsi800 = () => (
104114
<Wrapper>
105115
<LhrComparison lhr={lhrPsi800A} baseLhr={lhrPsi800B} hookElements={{}} />

packages/server/test/api/statistic-definitions.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const baseLhr800_ = require('../fixtures/lh-8-0-0-coursehero-a.json');
2323
const baselhr930_ = require('../fixtures/lh-9-3-0-coursehero-a.json');
2424
/** @type {any} */
2525
const baselhr1010_ = require('../fixtures/lh-10-1-0-coursehero-a.json');
26+
/** @type {any} */
27+
const baselhr1140_ = require('../fixtures/lh-11-4-0-coursehero-a.json');
2628
const {definitions} = require('../../src/api/statistic-definitions.js');
2729

2830
describe('Statistic Definitions', () => {
@@ -42,6 +44,8 @@ describe('Statistic Definitions', () => {
4244
const baselhr930 = baselhr930_;
4345
/** @type {LH.Result} */
4446
const baselhr1010 = baselhr1010_;
47+
/** @type {LH.Result} */
48+
const baselhr1140 = baselhr1140_;
4549

4650
describe('meta_lighthouse_version()', () => {
4751
const run = definitions.meta_lighthouse_version;
@@ -55,6 +59,7 @@ describe('Statistic Definitions', () => {
5559
expect(run([baseLhr800])).toEqual({value: 80000});
5660
expect(run([baselhr930])).toEqual({value: 90300});
5761
expect(run([baselhr1010])).toEqual({value: 100100});
62+
expect(run([baselhr1140])).toEqual({value: 110400});
5863
expect(run([{...baseLhr5, lighthouseVersion: '1.2.3-beta.0'}])).toEqual({value: 10203});
5964
});
6065

@@ -80,6 +85,7 @@ describe('Statistic Definitions', () => {
8085
expect(run([high, baseLhr800, low]).value).toBeCloseTo(20822.103);
8186
expect(run([high, baselhr930, low]).value).toBeCloseTo(20525.578);
8287
expect(run([high, baselhr1010, low]).value).toBeCloseTo(21627.392);
88+
expect(run([high, baselhr1140, low]).value).toBeCloseTo(80796.283);
8389
});
8490
});
8591

@@ -99,6 +105,7 @@ describe('Statistic Definitions', () => {
99105
expect(run([high, baseLhr800, low]).value).toBeCloseTo(0.24);
100106
expect(run([high, baselhr930, low]).value).toBeCloseTo(0.23);
101107
expect(run([high, baselhr1010, low]).value).toBeCloseTo(0.21);
108+
expect(run([high, baselhr1140, low]).value).toBeCloseTo(0.32);
102109
});
103110
});
104111

@@ -118,6 +125,7 @@ describe('Statistic Definitions', () => {
118125
expect(run([high, baseLhr800, low]).value).toBeCloseTo(0.01);
119126
expect(run([high, baselhr930, low]).value).toBeCloseTo(0.01);
120127
expect(run([high, baselhr1010, low]).value).toBeCloseTo(0.01);
128+
expect(run([high, baselhr1140, low]).value).toBeCloseTo(0.01);
121129
});
122130
});
123131

@@ -137,6 +145,7 @@ describe('Statistic Definitions', () => {
137145
expect(run([high, baseLhr800, low]).value).toBeCloseTo(0.99);
138146
expect(run([high, baselhr930, low]).value).toBeCloseTo(0.99);
139147
expect(run([high, baselhr1010, low]).value).toBeCloseTo(0.99);
148+
expect(run([high, baselhr1140, low]).value).toBeCloseTo(0.99);
140149
});
141150
});
142151

@@ -150,6 +159,7 @@ describe('Statistic Definitions', () => {
150159
expect(definitions['auditgroup_a11y-aria_pass']([baseLhr800])).toEqual({value: 6});
151160
expect(definitions['auditgroup_a11y-aria_pass']([baselhr930])).toEqual({value: 8});
152161
expect(definitions['auditgroup_a11y-aria_pass']([baselhr1010])).toEqual({value: 8});
162+
expect(definitions['auditgroup_a11y-aria_pass']([baselhr1140])).toEqual({value: 9});
153163
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr5])).toEqual({value: 0});
154164
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr6])).toEqual({value: 1});
155165
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr62])).toEqual({value: 1});
@@ -158,6 +168,7 @@ describe('Statistic Definitions', () => {
158168
expect(definitions['auditgroup_a11y-color-contrast_fail']([baseLhr800])).toEqual({value: 1});
159169
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr930])).toEqual({value: 1});
160170
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr1010])).toEqual({value: 1});
171+
expect(definitions['auditgroup_a11y-color-contrast_fail']([baselhr1140])).toEqual({value: 1});
161172
expect(definitions['auditgroup_a11y-aria_na']([baseLhr5])).toEqual({value: 0});
162173
expect(definitions['auditgroup_a11y-aria_na']([baseLhr6])).toEqual({value: 2});
163174
expect(definitions['auditgroup_a11y-aria_na']([baseLhr62])).toEqual({value: 2});
@@ -166,6 +177,7 @@ describe('Statistic Definitions', () => {
166177
expect(definitions['auditgroup_a11y-aria_na']([baseLhr800])).toEqual({value: 11});
167178
expect(definitions['auditgroup_a11y-aria_na']([baselhr930])).toEqual({value: 9});
168179
expect(definitions['auditgroup_a11y-aria_na']([baselhr1010])).toEqual({value: 9});
180+
expect(definitions['auditgroup_a11y-aria_na']([baselhr1140])).toEqual({value: 9});
169181
});
170182
});
171183
});

packages/server/test/e2e/project-dashboard-mixed-v5-v6.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ describe('Project dashboard', () => {
2929

3030
expect(commits).toMatchInlineSnapshot(`
3131
[
32+
"1252build 18call_splitmasterMay 28 6:00 AM",
33+
"1251build 17call_splitmasterMay 27 6:00 AM",
3234
"1250build 16call_splitmasterMay 26 6:00 AM",
3335
"1249build 15call_splitmasterMay 25 6:00 AM",
3436
"1248build 14call_splitmasterMay 24 6:00 AM",
35-
"1247build 13call_splitmasterMay 23 6:00 AM",
36-
"1246build 12call_splitmasterMay 22 6:00 AM",
3737
]
3838
`);
3939
});
@@ -45,7 +45,9 @@ describe('Project dashboard', () => {
4545
it('should render graphs for previously unavailable data', async () => {
4646
await state.page.evaluate(() => {
4747
const graphs = Array.from(document.querySelectorAll('.metric-line-graph__graph'));
48-
if (graphs.length !== 2) throw new Error('Should have found 2 metric graphs');
48+
if (graphs.length !== 2) {
49+
throw new Error(`Should have found 2 metric graphs, but got ${graphs.length}`);
50+
}
4951

5052
window.scrollTo({top: graphs[0].getBoundingClientRect().top - 50});
5153
return new Promise(resolve => requestAnimationFrame(resolve));

0 commit comments

Comments
 (0)