On Travis, restrict Cucumber tests to MySQL builds

This commit is contained in:
Dan Rice 2016-02-14 22:47:29 -05:00
parent fe359cf52e
commit a6f9be2d84
2 changed files with 28 additions and 11 deletions

View file

@ -21,7 +21,7 @@ before_script:
- "sh -e /etc/init.d/xvfb start"
- "cp config/site.yml.tmpl config/site.yml"
script: "bin/rake ci"
script: "if [[ $DATABASE_URL == mysql* ]]; then bundle exec rake ci:full; else bundle exec rake ci:lite; fi"
notifications:
email: false

View file

@ -1,15 +1,32 @@
task :ci do |t|
ENV['RAILS_ENV'] ||= "test"
namespace :ci do
desc 'Continuous integration tests, without features'
task :lite do
ENV['RAILS_ENV'] ||= "test"
# test coverage from codeclimate
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
puts 'Running "lite" test suite'
# local test coverage
require 'simplecov'
SimpleCov.start 'rails'
[:environment, 'db:create', 'test:all'].each do |t|
Rake::Task[t].invoke
end
end
[:environment, 'db:create', 'test:all', 'cucumber'].each do |t|
Rake::Task[t].invoke
desc 'Continuous integration tests, including features'
task :full do |t|
puts 'Running full test suite'
# test coverage from codeclimate
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
# local test coverage
require 'simplecov'
SimpleCov.start 'rails'
['ci:lite', 'cucumber'].each do |t|
Rake::Task[t].invoke
end
end
end
desc 'Alias for ci:full'
task :ci => 'ci:full'