Speed up Your Builds with Codeship Parallel Test Pipelines

Home  >>  Common  >>  Speed up Your Builds with Codeship Parallel Test Pipelines

Speed up Your Builds with Codeship Parallel Test Pipelines

On February 17, 2015, Posted by , In Common,Eclipse, By ,, , With Comments Off on Speed up Your Builds with Codeship Parallel Test Pipelines

Some time ago we were in need for a hosted CI service for a project that was held in a private GitHub repository. And in Codeship we found a suitable solution to build, test and deploy the code from the private repository.

Soon we got excited by the reliable internet connection and plenty of computing power the Codeship infrastructure offered. And last week, Codeship introduced a feature to build even faster, which I would like to briefly represent here.

Multi-Target Builds

Often software needs to run on different targets. Be it a certain version of a framework that the software runs on top of or a certain operating system environment. As a consequence, it must be verified that the tests are executed successfully on all desired targets while the software is built.

Many of the projecs we work on are Eclipse Plug-ins, like Gonsole, Eclipse Extras or Xiliary. In order to ensure that the code we write works across all commonly used versions of Eclipse, we run the tests on the latest version of the 3.x development stream (i.e. 3.8), the most recent release version (currently 4.4) and sometimes also the latest milestone of the release under development.

Until recently, our build instructions looked like this:

mvn verify -Dtarget-platform=eclipse-3.8
mvn verify -Dtarget-platform=eclipse-4.4

Which will first build and run tests against Eclipse 3.8 and then do the same again for Eclipse 4.4, one by one.

Parallelize Your Builds

These two build steps are independant of each other and could as well be run in parallel – and this is exactly what Codeship is now prepared for: parallel test pipelines. Each build can have multiple test pipelines that are run in parallel. The commands of each pipeline are run independently of each other in a separate virtual machine. With this feature in place, the build instructions from the example above now looks like this:

See also  Code Centric Trainings with the Samples Manager

For each pipeline, the commands to run need to be specified. To distinguish them, each test pipeline can be given a name. If all test pipelines share a common set up, a set of commands can be specified that is run before each pipeline.

When a build is run, the overview page shows progress and output for each pipeline.

The TEST COMMANDS and DEPLOY COMMANDS sections can be expanded to reveal the details. Click on the image to see how the expanded version looks like. The build steps from the example above that were executed consecutively will now be run in parallel and the whole process takes roughly half of the time than before.

Deployment

If deployment commands are configured for a certain branch and each test pipeline reports success, the deployment commands will be run.

As the name test pipeline implies, the focus is on testing. None of the artifacts created during the test steps are preserved and they are not available during the deployment step.

Hence the deployment step needs to re-create the artifacts to deploy. In our case, we run the build again, this time without running the tests.

mvn verify -DskipTests

Even with partially repeating a build step for deployment, the overall gain is worthwhile. Plus, we heard rumors that there are plans to make artifacts that are created during test steps available to deployment steps.

Try Codeship Parallel Test Pipelines Yourself

If parallel builds caught your interest, the documentation page holds more information. Unfortunately, the ‘free plan’ provides only a single test pipeline so that you either need to resort to one of the ‘paid plans’ or kindly ask the friendly folks at Codeship if they can provide you more than one pipeline to test drive the new feature.

Rüdiger Herrmann
Follow me
Latest posts by Rüdiger Herrmann (see all)
Comments are closed.