-
Notifications
You must be signed in to change notification settings - Fork 14
/
.lighthouserc.js
72 lines (72 loc) · 3.58 KB
/
.lighthouserc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
module.exports = {
ci: {
collect: {
url: [
// TODO: Develop a test with representative homepage example content:
// https://reload.atlassian.net/browse/DDFLSBP-668
// "http://varnish:8080/",
"http://varnish:8080/search?q=harry+potter&x=0&y=0",
"http://varnish:8080/work/work-of:870970-basis:25245784?type=bog",
"http://varnish:8080/articles",
// TODO: Disabled because repeated events are not tap-friendly DDFFORM-929
//"http://varnish:8080/events",
"http://varnish:8080/branches",
// Article page from DPL Example Content
// TODO: Disabled because links in new window do not use rel="noopener" DDFFORM-925
// "http://varnish:8080/by_uuid/node/2cd0fe5e-4159-4452-86aa-e1a1ac8db4a1",
// Event instance page from DPL Example Content
// TODO: Disabled because links in new window do not use rel="noopener" DDFFORM-925
// "http://varnish:8080/by_uuid/eventseries/c8177097-1438-493e-8177-e8ef968cc133",
// Branch page from DPL Example Content
"http://varnish:8080/by_uuid/node/dac275e4-9b8c-4959-a13a-6b9fdbc1f6b0",
// Create user page from DPL Static Content
"http://varnish:8080/by_uuid/node/e68b90e6-cd35-44c6-9e32-c05c982ed315",
// Contact page with webform from DPL Static Content
"http://varnish:8080/by_uuid/node/d50683cc-8011-49ba-a6ea-82e56de97b80",
],
// Use only 1 run to improve test speed. Multiple runs to handle caching
// should not be required while we have downgraded performance from
// error to warning.
numberOfRuns: 1,
settings: {
chromeFlags: "--no-sandbox",
// Lighthouse best practices require HTTPS but we do not this available
// on our CI environments so disable that check. It should not keep our
// score down.
skipAudits: ["is-on-https"],
throttling: {
// Lighthouse will throttle CPU by 4x by default to mimick the
// performance of a mid-range smartphone instead of a desktop
// workstation. That does not hold for us:
// 1. Experience shows that Docker containers and GitHub Actions
// runners have significantly fewer resources and classifies
// as a low-end desktop
// 2. Lighthouse targets a Moto G4 from 2016 as the mid-range device.
// We expect this to be underpowered compared to our target user
// range. Instead we target their definition of a high-end
// smartphone - a Samsung S10 from 2019.
// Low-end desktop testing as high-end mobile yields a 1x multiplier:
// https://github.com/GoogleChrome/lighthouse/blob/main/docs/throttling.md#cpu-throttling
cpuSlowdownMultiplier: 1,
},
},
},
assert: {
assertions: {
// Our quality standard requires all categories to be green. Green
// translates to a score between 90 and 100 - or 0.9-1.
// TODO: Implement inline critial CSS to raise score above 0.9
// TODO: Implement depedency splitting to raise score above 0.75
"categories:performance": ["warn", { minScore: 0.75 }],
"categories:accessibility": ["error", { minScore: 0.9 }],
"categories:best-practices": ["error", { minScore: 0.9 }],
"categories:seo": ["error", { minScore: 0.9 }],
},
},
upload: {
// Update to Googles public storage to make reports easily accessible.
// The fact that the storage is public is fine. The project is open.
target: "temporary-public-storage",
},
},
};