Ubuntu has had a package for ~4 years now. Annoyingly as per history it has a different name than the Debian package does.
In case someone wants to try this for themselves, roll out a fresh server (like a Digital Ocean high CPU instance as they are quick enough and cheap enough for a quick spin like this).
Chrome needs to run as non-root. Otherwise you'd have to pass in all sorts of flags like turning off the sandbox and the GPU support. A lot of people out there seem to be confused over this.
Debian:
#!/bin/bash
set -e
apt update
apt build-dep -y python python-imaging python-lxml python-pyscss python-yaml
apt install -y git python-pip python-virtualenv wv pdftohtml locales-all xvfb chromedriver
useradd -m plone
cd /home/plone
su plone -c 'git clone https://github.com/plone/buildout.coredev.git'
cd buildout.coredev
su plone -c './bootstrap.sh'
su plone -c 'ROBOT_BROWSER='chrome' xvfb-run bin/alltests --all --xml'
su plone -c 'bin/alltests-at --all --xml'
Ubuntu:
#!/bin/bash
set -e
apt update
apt build-dep -y python python-imaging python-lxml python-pyscss python-yaml
apt install -y git python-pip python-virtualenv wv pdftohtml locales-all xvfb chromium-chromedriver
useradd -m plone
cd /home/plone
su plone -c 'git clone https://github.com/plone/buildout.coredev.git'
cd buildout.coredev
su plone -c './bootstrap.sh'
su plone -c 'ROBOT_BROWSER='chrome' xvfb-run bin/alltests --all --xml'
su plone -c 'bin/alltests-at --all --xml'
Do note the use of build-dep
for getting the build-time dependencies of Plone. This brings in a bit of unnecessary packaging tooling as well and is thus not the minimal set, but is worth noting as a concept for the simplicity of tackling the "dependency hell" scenario of "urgh, I need to build package foo now". If the package has a compatible enough version in the distro tree, apt build-dep foo
and be done with it (apt-get
and aptitude
also have this feature).
I've also added locales-all
to the packages as your ssh session can try to bring in your machine locale and that not being available can flunk the bootstrap script. If you have a funkier locale setup on your workstation side and that gets in the way, simply do su plone -c "LC_ALL='C' ./bootstrap.sh"
for that step to circumvent.
Older versions of Ubuntu might not yet have apt
installed per default, so install apt
or substitute with apt-get
or aptitude
where appropriate for your testing (but do note aptitude
pulls in recommended packages per default as well while the others do not).
Likewise if desiring to use Gecko, use firefoxdriver
instead of chromedriver
and ROBOT_BROWSER='firefox'
instead of ROBOT_BROWSER='chrome'
(or leave it undefined as Firefox is the default).
This should also work with the distro packages on Travis. @tisto, wanna give that a try as well?
As the packages in question are volatile, if one wants to pin exact versions of something for repeatability, apt has a syntax of package=versionname
for this. On Debian 9, for example, one could do apt install chromium-driver=62.0.3202.89-1~deb9u1 chromium=62.0.3202.89-1~deb9u1
while the current packages are based on Chrome 64 at the moment.
Pulling it in manually does give you more control over the exact version range available, as you can also pull in versions not available in the distro tree, though.