Oct 29, 2013

Testing Grails With a Travis Build Matrix

Continuous integration testing can be configured to create a build matrix to test multiple configurations of a project using a single build configuration.  This can be useful if you want to test a Grails application with multiple Grails versions, to test plugins with multiple Grails versions, or to test using varying configuration values.

The Travis CI build tool has a build matrix feature which allows you to specify multiple configuration parameters in the .travis.yml configuration file and runs the build against all possible combinations of these parameters. In the following example, I use the Groovy enVironment Manager (GVM) to change Grails versions between tests. I found this blog post which details how to set up GVM for Travis and updated this approach to force the GVM install command to return success instead of the workaround given there. The env block in the .travis.yml specifies the different environment parameters which will be passed to each test run to create the build matrix:

The example build result below shows the different Grails version on the right used for each build. The source code for this example project can be found on Github.

Example Travis build matrix output of a Grails project build using GVM

More information about configuring a build matrix for Travis can be found in the Travis CI documentation.

About the Author

Object Partners profile.
Leave a Reply

Your email address will not be published. Required fields are marked *

Related Blog Posts
Feature Flags in Terraform
Feature flagging any code can be useful to developers but many don’t know how to or even that you can do it in Terraform. Some benefits of Feature Flagging your code You can enable different […]
Infrastructure as Code – The Wrong Way
You are probably familiar with the term “infrastructure as code”. It’s a great concept, and it’s gaining steam in the industry. Unfortunately, just as we had a lot to learn about how to write clean […]
Snowflake CI/CD using Jenkins and Schemachange
CI/CD and Management of Data Warehouses can be a serious challenge. In this blog you will learn how to setup CI/CD for Snowflake using Schemachange, Github, and Jenkins. For access to the code check out […]
How to get your pull requests approved more quickly
TL;DR The fewer reviews necessary, the quicker your PR gets approved. Code reviews serve an essential function on any software codebase. Done right, they help ensure correctness, reliability, and maintainability of code. On many teams, […]