question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support and docs for Gitlab CI

See original GitHub issue

Trying to use lhci in Gitlab-CI. I am getting a CHROME_PATH must be set... error. See logs below:


291 $ yarn test:lighthouse
292 yarn run v1.19.1
293 $ lhci autorun
294 ✅  .lighthouseci/ directory writable
295 ✅  Configuration file found
296 ⚠️   GitHub token not set
297 Healthcheck passed!
298 Automatically determined ./public as `staticDistDir`.
299 Set it explicitly in lighthouserc.json if incorrect.
300 Started a web server on port 38319...
301 Running Lighthouse 3 time(s) on http://localhost:38319/404.html
302 Run #1...failed!
303 Error: Lighthouse failed with exit code 1
304     at ChildProcess.process.on.code (/builds/origenstudio/gatsby-starter-default/node_modules/@lhci/cli/src/collect/lighthouse-runner.js:102:21)
305     at ChildProcess.emit (events.js:198:13)
306     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
307 Runtime error encountered: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.

I’ve tried to use a service to install chrome. I have used the chromedp/headless-shell:latest docker image, however the error remains.

Has anyone configure lhci in Gitlab?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:20

github_iconTop GitHub Comments

3reactions
gaurav5430commented, Jun 6, 2020

In case it is helpful to someone, I have written about how I integrated lighthouse-ci and lighthouse ci server to my gitlab CI workflow as a proof of concept.

Here is the article: https://medium.com/@gaurav5430/web-performance-integrating-lightouse-ci-in-your-gitlab-ci-cd-pipeline-129c788591bd?source=friends_link&sk=ef3fdc7c3146ceae3432dd3b09c6e243

2reactions
Lusitaniaecommented, Dec 11, 2019

I’m having the same issue.

Solved by using circleci image and adding sudo to npm install -g @lhci/cli@0.3.x

perf_test:
  image: circleci/node:10.16-browsers
  stage: test
  script:
    - npm install
    - npm run build
    - sudo npm install -g @lhci/cli@0.3.x
    - |
      lhci collect  \
       --url=https://example.com \
       --upload.target=temporary-public-storage \
       --collect.settings.chromeFlags="--no-sandbox" \
      || echo "LHCI failed!"

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitLab CI/CD
Learn how to use GitLab CI/CD, the GitLab built-in Continuous Integration, Continuous Deployment, and Continuous Delivery toolset to build, test, ...
Read more >
`.gitlab-ci.yml` keyword reference - GitLab Docs
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
Read more >
The `.gitlab-ci.yml` file - GitLab Docs
Application code hosted in a Git repository. A file called .gitlab-ci.yml in the root of your repository, which contains the CI/CD configuration. In ......
Read more >
Services - GitLab Docs
Setting a command for the service ... Introduced in GitLab and GitLab Runner 9.4. Read more about the extended configuration options. Let's assume...
Read more >
GitLab Documentation
Agile with GitLab. Manage your work with built-in agile features. Issues · Issue boards · Labels ; CI/CD. Build, test, and deploy applications...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found