aboutsummaryrefslogtreecommitdiffstats
path: root/ci/travis.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ci/travis.rb')
-rwxr-xr-xci/travis.rb60
1 files changed, 50 insertions, 10 deletions
diff --git a/ci/travis.rb b/ci/travis.rb
index b62f90a59e..e9a3626b9a 100755
--- a/ci/travis.rb
+++ b/ci/travis.rb
@@ -16,13 +16,15 @@ end
class Build
MAP = {
'railties' => 'railties',
- 'ap' => 'actionpack',
- 'am' => 'actionmailer',
- 'amo' => 'activemodel',
- 'as' => 'activesupport',
- 'ar' => 'activerecord',
- 'av' => 'actionview',
- 'aj' => 'activejob'
+ 'ap' => 'actionpack',
+ 'am' => 'actionmailer',
+ 'amo' => 'activemodel',
+ 'as' => 'activesupport',
+ 'ar' => 'activerecord',
+ 'av' => 'actionview',
+ 'aj' => 'activejob',
+ 'ac' => 'actioncable',
+ 'guides' => 'guides'
}
attr_reader :component, :options
@@ -36,7 +38,11 @@ class Build
self.options.update(options)
Dir.chdir(dir) do
announce(heading)
- rake(*tasks)
+ if guides?
+ run_bug_report_templates
+ else
+ rake(*tasks)
+ end
end
end
@@ -54,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
@@ -67,10 +80,18 @@ class Build
key.join(':')
end
+ def activesupport?
+ gem == 'activesupport'
+ end
+
def activerecord?
gem == 'activerecord'
end
+ def guides?
+ gem == 'guides'
+ end
+
def isolated?
options[:isolated]
end
@@ -92,10 +113,27 @@ 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)
+ end
+ end
end
if ENV['GEM']=='aj:integration'
@@ -109,7 +147,9 @@ 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
build = Build.new(gem, :isolated => isolated)
results[build.key] = build.run!