A few months ago, we wrote an article on how Camptocamp is running acceptance tests of its Puppet modules from Travis using Beaker and our OpenStack infrastructure. It worked quite well for us for a few months, but today Travis CI upgraded its infrastructure and now allows using Docker on Travis CI.
So now we are able to run Puppet modules acceptance tests directly on Travis CI using Beaker’s Docker Hypervisor backend, and here below is how to do it:
First, let’s write a very simple .travis.yml file:
Then two nodesets in spec/acceptance/nodesets,
One for Debian8:
And one for Centos7:
Using Docker on Travis CI simplifies our previous setup based on our OpenStack infrastructure as we don’t have to encrypt our credentials. It also has the huge advantage of working with Pull Requests. However, as a docker container is not a real virtual machine, we still have some issues to make it work in some cases, especially dealing with systemd and SELinux. But we’ll try to find some workaround.
Finally, here is the output it produces when using this setup with our Puppet OpenLDAP module: