I am trying to run lighthouse on a CI service (GitLab CI). Every time I run the lighthouse command, I get this error -
(node:157) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'kill' of undefined
What is the recommended way to run Google Lighthouse in a CI environment?
I saw the download-chrome.sh but was not sure if that was required. Does chrome need to be downloaded and ran for Lighthouse to work? Is there a headless alternative?
Just want to know what my options are so I can make this successful. =)
It seems like lighthouse can't connect to a chrome instance. Do you have the LIGHTHOUSE_CHROMIUM_PATH variable set?
Do you a chrome version that is accessible to lighthouse in your CI environment?
If you use docker or know how, this repo may help you figure something out: https://github.com/justinribeiro/dockerfiles
I copied this from some build I saw on travis CI for Lighthouse. May be going the wrong way.
- export DISPLAY=:99.0
- export LIGHTHOUSE_CHROMIUM_PATH="$(pwd)/chrome-linux/chrome"
- ./node_modules/lighthouse/lighthouse-core/scripts/download-chrome.sh
- start-stop-daemon --start --background --exec $(pwd)/chrome-linux/chrome
- sleep 5
- npm run lighthouse
This is a snipped from my gitlab-ci.yml file. I have to admit I do not know why the code that I copied had start-stop-daemon. But I have it downloading chrome and installing in /chrome-linux correctly.
In the output I can see the unpacking action of the Chrome zip.
Even using the lighthouse docker image, I am still seeing the same error.
Tue, 07 Feb 2017 12:49:26 GMT Lighthouse CLI Launching Chrome...
(node:73) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'kill' of undefined
Going to close this as it's pretty old.
We have some docs on CI testing here. Also check out how to use chrome-launcher from CI and our .travis.yaml for another example.
If you're using Docker, see https://github.com/ebidel/lighthouse-ci/blob/master/builder/Dockerfile.nonheadless.
Most helpful comment
Going to close this as it's pretty old.
We have some docs on CI testing here. Also check out how to use chrome-launcher from CI and our .travis.yaml for another example.
If you're using Docker, see https://github.com/ebidel/lighthouse-ci/blob/master/builder/Dockerfile.nonheadless.