Read more at http://about.travis-ci.org/blog/2012-11-27-shipping-the-new-travis-ci-ui-for-pro/
In my app, I do not use default rails integration tests, instead I use cucumber for it. Due to the fact cucumber does not override rake test:integrations
and must be execute separately. Below is a solution that I came up with to have your Travis running units + functionals + cucumber tests:
First creating a simple bash script at RAILS_ROOT/ci.sh
:
#!/bin/bash
case $1 in
units) echo "Run units tests"
bundle exec rake test:units
;;
functionals) echo "Run functionals tests"
bundle exec rake test:functionals
;;
cucumber) echo "Run cucumber suite"
bundle exec cucumber -t @success
;;
esac
and edit your .travis.yml
:
env:
- TEST_SUITE=units
- TEST_SUITE=functionals
- TEST_SUITE=cucumber
script:
- ci.sh $TEST_SUITE
ci.sh
will work out which test to run by looking up the TEST_SUITE
env variable. Simple but works!