diff --git a/.travis.yml b/.travis.yml index 0a0a55517f..fb9f4edf7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,24 @@ language: ruby bundler_args: --without development rvm: - "1.9.3" -services: postgresql -before_install: + +# The test cases are roughly split according to their test times. +# It would be better to use https://github.com/ArturT/knapsack. +env: + - TEST_CASES="./spec/models" + - TEST_CASES="./spec/controllers ./spec/views" + - TEST_CASES="./spec/requests ./spec/helpers ./spec/mailers" + - TEST_CASES="./spec/features/admin" + - TEST_CASES="./spec/features/consumer" + #- TEST_CASES="./spec/routing" + before_script: - cp config/database.travis.yml config/database.yml - - psql -c 'create database open_food_network_test;' -U postgres - cp config/application.yml.example config/application.yml + - RAILS_ENV=test bundle exec rake db:create db:schema:load + script: - - RAILS_ENV=test bundle exec rake db:migrate --trace - - bundle exec rake spec + - "bundle exec rspec $TEST_CASES" + notifications: email: false