mbland / custom-links

An application for allowing authenticated users to create and dereference custom URLs hosted on a custom domain.
ISC License
7 stars 1 forks source link

Apply Google Chrome --no-sandbox flag to fix Travis CI and enable headless Firefox #169

Closed mbland closed 6 years ago

mbland commented 6 years ago

Pull requests started failing Travis CI builds with the following message:

05 02 2018 20:50:18.131:ERROR [launcher]: Cannot start ChromeHeadless
    [0205/205017.988204:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.

From: https://travis-ci.org/mbland/custom-links/jobs/337734109

As it turns out, Chrome is now directly supported as an addon (rather than requiring it be installed via addons: apt: packages: -google-chrome-stable), and the source of the error is well-documented in the Travis docs:

https://docs.travis-ci.com/user/chrome#Sandboxing

This change applies the --no-sandbox flag for headless Google Chrome via the ./go test browser --single-run command, via Karma, and via ./go test end-to-end. Updated the mocha-chrome package and moved it from dependencies: to devDependencies: in the process.

Since this change removes xvfb, I also took the opportunity to switch to headless Firefox in the process via:

https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-the-Firefox-addon-in-headless-mode

mbland commented 6 years ago

Coveralls is dragging in pushing its report to GitHub...will merge now, but keep the branch around until the Coveralls run has reported back.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 98.061% when pulling e588c3f5dc80a634a613ba42d9a955e3165d3c53 on travis-ci-fix into 42960b67895db0215b86627a3ae90a0fa2186ecd on master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 98.061% when pulling e588c3f5dc80a634a613ba42d9a955e3165d3c53 on travis-ci-fix into 42960b67895db0215b86627a3ae90a0fa2186ecd on master.