Skip to content

Commit e7c9f75

Browse files
dooman87@gmail.comdooman87@gmail.com
authored andcommitted
FIX: Old Chromium doesn't emit LCP metric
1 parent 7ada802 commit e7c9f75

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea
2-
*.iml
2+
*.iml
3+
.lighthouseci/*.json
4+
.lighthouseci/*.html

.lighthouseci/.empty

Whitespace-only changes.

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12.13-alpine3.10
1+
FROM node:12.17-alpine3.11
22

33
RUN apk add --no-cache chromium
44
RUN npm install -g @lhci/cli@0.4.0
@@ -10,5 +10,9 @@ RUN addgroup lhci \
1010
--home /home/lhci \
1111
--ingroup lhci \
1212
lhci
13+
1314
USER lhci
1415
WORKDIR /home/lhci
16+
17+
RUN mkdir .lighthouseci
18+
VOLUME .lighthouseci

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ Docker image for [Lighthouse CI CLI](https://github.com/GoogleChrome/lighthouse-
1515

1616
## Usage
1717

18+
### Locally
19+
20+
```
21+
docker run -it --rm -v $(pwd)/example:/home/lhci/example -v $(pwd)/.lighthouseci:/home/lhci/.lighthouseci lhci lhci --config ./example/lighthouserc.example.yaml autorun
22+
```
23+
24+
### In CI Pipeline
1825
We are using this image in our Bitbucket Pipeline as a step to run LH tests and then upload results to
1926
Google Cloud Storage.
2027

example/lighthouserc.example.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ci:
2+
collect:
3+
additive: false
4+
url:
5+
- https://pixboost.com
6+
settings:
7+
chrome-flags: "--no-sandbox --headless"
8+
throttling-method: simulate
9+
# https://github.com/GoogleChrome/lighthouse/blob/8f500e00243e07ef0a80b39334bedcc8ddc8d3d0/lighthouse-core/config/constants.js#L19-L26
10+
throttling:
11+
throughputKbps: 1638
12+
uploadThroughputKbps: 675
13+
cpuSlowdownMultiplier: 4
14+
assert:
15+
preset: lighthouse:no-pwa

0 commit comments

Comments
 (0)