diff options
Diffstat (limited to 'ci/travis.rb')
-rwxr-xr-x | ci/travis.rb | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/ci/travis.rb b/ci/travis.rb index 52fef05fbf..e9a3626b9a 100755 --- a/ci/travis.rb +++ b/ci/travis.rb @@ -23,6 +23,7 @@ class Build 'ar' => 'activerecord', 'av' => 'actionview', 'aj' => 'activejob', + 'ac' => 'actioncable', 'guides' => 'guides' } @@ -59,7 +60,14 @@ class Build def tasks if activerecord? - ['db:mysql:rebuild', "#{adapter}:#{'isolated_' if isolated?}test"] + tasks = ["#{adapter}:#{'isolated_' if isolated?}test"] + case adapter + when 'mysql2' + tasks.unshift 'db:mysql:rebuild' + when 'postgresql' + tasks.unshift 'db:postgresql:rebuild' + end + tasks else ["test", ('isolated' if isolated?), ('integration' if integration?)].compact.join(":") end @@ -72,6 +80,10 @@ class Build key.join(':') end + def activesupport? + gem == 'activesupport' + end + def activerecord? gem == 'activerecord' end @@ -101,11 +113,22 @@ class Build tasks.each do |task| cmd = "bundle exec rake #{task}" puts "Running command: #{cmd}" - return false unless system(cmd) + return false unless system(env, cmd) end true end + def env + if activesupport? && !isolated? + # There is a known issue with the listen tests that casuses files to be + # incorrectly GC'ed even when they are still in-use. The current is to + # only run them in isolation to avoid randomly failing our test suite. + { 'LISTEN' => '0' } + else + {} + end + end + def run_bug_report_templates Dir.glob('bug_report_templates/*.rb').all? do |file| system(Gem.ruby, '-w', file) @@ -124,6 +147,7 @@ ENV['GEM'].split(',').each do |gem| [false, true].each do |isolated| next if ENV['TRAVIS_PULL_REQUEST'] && ENV['TRAVIS_PULL_REQUEST'] != 'false' && isolated next if gem == 'railties' && isolated + next if gem == 'ac' && isolated next if gem == 'aj:integration' && isolated next if gem == 'guides' && isolated |