Travis CI XVFB Breaking Change
This morning I was greeted by a bunch of failing front-end builds on Travis CI because XVFB couldn’t start. Here’s how to fix it.
Unfortunately, they broke all existing builds based on their documentation, which had you set it up like this:
before_script: # start XVFB to test the extension (headless does not install extensions fully) # https://docs.travis-ci.com/user/gui-and-headless-browsers/#using-xvfb-to-run-tests-that-require-a-gui - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - sleep 3 # give xvfb some time to start
Starting on January 15, 2019, your builds will start failing with messages like this:
$ export DISPLAY=:99.0 $ sh -e /etc/init.d/xvfb start sh: 0: Can't open /etc/init.d/xvfb The command "sh -e /etc/init.d/xvfb start" failed and exited with 127 during .
You need to remove the portion of your
before_script that starts
instead use the new syntax of:
services: - xvfb
This is now documented in their documentation, so check that out for more information.