Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighthouse on CI #1645

Closed
khrome83 opened this issue Feb 6, 2017 · 4 comments
Closed

Lighthouse on CI #1645

khrome83 opened this issue Feb 6, 2017 · 4 comments
Labels

Comments

@khrome83
Copy link

khrome83 commented Feb 6, 2017

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. =)

@pedro93
Copy link

pedro93 commented Feb 6, 2017

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

@khrome83
Copy link
Author

khrome83 commented Feb 6, 2017

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.

@khrome83
Copy link
Author

khrome83 commented Feb 7, 2017

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

@ebidel
Copy link
Contributor

ebidel commented Jun 21, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants