I’ve been working on the Continuous Integration testing of Google Chrome and Chromium since 2008. As a matter of fact Chromium has a very large Buildbot based CI infrastructure that is open source. You can get a glimpse at chromium-build.appspot.com.
Chromium finished migrating to Swarming based task execution hosted on Google AppEngine [edit] in early 2019.
In the context of my personal project pre-commit-go, I had the chance to try out a few hosted Continuous Integration services offering Go support. I sampled 4 that could be used for free for open source projects.
Since pre-commit-go is a project that does check the state of the repository when running and also installs dependencies via go get as part of its normal operation, its smoke tests tend to be more complex than usual and I did hit many corner cases, which is even more interesting in the context of this review.
$GOPATH
at its expected location and
$GOPATH/bin
is in $PATH
. This results is a very low fuzz setup.
.travis.yml
. Not everyone is
comfortable with this. On the other hand, this clearly states what is
supported and what is the testing scenario, unlike other services which can
have configuration modified out-of-band.
.travis.yml
.
$GOPATH
:
/home/ubuntu/.go_workspace:/usr/local/go_workspace
.
~/PROJECT_NAME
with your project name instead of inside
$GOPATH
.
readlink -f .
returns a path outside of $GOPATH
.
~/.go_project/src/<repo/path>
which contained a symlink
to the project checkout that is directly in ~/
but this changed mid-June
2015 without alert!
~/.go_workspace/bin
was not in $PATH
. You had to add it
manually if needed.
$GOPATH
. It is ~/clone
which is a
symlink to the right directory inside $GOPATH
. cd’ing to the right
directory works just fine but that is not Go idiomatic at all.
Unlike other services, drone can be run stand alone on your own VM; https://github.com/drone/drone. On the other hand, it is relatively barebone compared to the other services.
I sampled 4 hosted services but there are many others. Many include support for deployment, which is not covered in this review but is an excellent feature. For example I personally use the codeship’s deployment feature as part of webskel.
This is very nice of these services to offer free builds for open source projects. This permits running tests on pull requests and trying out the service before paying. For small open sources projects, this permits having a no-fuzz no-maintenance CI system for free, which is incredible.
On the other hand, throughout the years a few hosted services failed and disappeared. This is something to take in account as you settle for an hosted service.
As for which service to use, it depends on your use-case. I found SSH support to be immensely useful but both Codeship and CircleCI use non Go idiomatic checkout layout and both use an outdated version of Go. Both issues are very concerning. Travis is very feature complete, no fuzz and works fine for open source projects but many found is slow to their taste and it requires you to check in a .travis.yml file in your repository. Drone is a bit of an outlier as it is open source and can be run by yourself in a docker image but I haven’t tested this use case.
If you have to run tests on a Go project, check out pre-commit-go as a free open source tool to run tests efficiently.