The goal of this project is to provide Travis support for any Redmine plugin author.
The assumption here is that your plugin will be using the standard Rails tests that derive from ActionController::TestCase and ActiveSupport::TestCase.
Other testing infrastructures can be used, but the run_tests()
function of the .travis-init.sh
file would need to be adapted.
In order to take advantage of the Travis continuous integration service, you'll need to have your plugin hosted on Github.
- Copy the
.travis*
files to the root of your plugin. - Edit the
.travis.yml
file and update the PLUGIN export with your plugin name - Commit the updates to your repository and push to Github
- Register your project with Travis (see their Getting Started guide for more info)
An annotated sample is provided below to help get everything up and running.
language: ruby # has to be ruby, as Redmine is a Ruby on Rails application ;)
rvm:
- 2.0.0 # versions of ruby to test against
- 1.9.3
branches: # if we're building against something other than the master
only: # branch on Github
- testing
env:
- REDMINE_VERSION=2.3.3 VERBOSE=yes # The version of redmine to use when testing
script:
- export PLUGIN=<add plugin name here> # The name of the plugin that we're testing
- export WORKSPACE=$(pwd)/workspace
- export PATH_TO_PLUGIN=$(pwd)
- export PATH_TO_REDMINE=$WORKSPACE/redmine
- mkdir $WORKSPACE
- bash -x ./.travis-init.sh -r || exit 1
- bash -x ./.travis-init.sh -i || exit 1
- bash -x ./.travis-init.sh -t || exit 1
- bash -x ./.travis-init.sh -u || exit 1
See the Travis CI configuration guide for more advanced options.
The configuration and scripts were extracted and modified from work done by the authors of the Redmine Backlogs project. None of this would be possible without their original efforts, so big ups from me to them!