diff options
Diffstat (limited to 'ci/travis.rb')
-rwxr-xr-x | ci/travis.rb | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/ci/travis.rb b/ci/travis.rb index 956a01dbee..52fef05fbf 100755 --- a/ci/travis.rb +++ b/ci/travis.rb @@ -16,12 +16,14 @@ end class Build MAP = { 'railties' => 'railties', - 'ap' => 'actionpack', - 'am' => 'actionmailer', - 'amo' => 'activemodel', - 'as' => 'activesupport', - 'ar' => 'activerecord', - 'av' => 'actionview' + 'ap' => 'actionpack', + 'am' => 'actionmailer', + 'amo' => 'activemodel', + 'as' => 'activesupport', + 'ar' => 'activerecord', + 'av' => 'actionview', + 'aj' => 'activejob', + 'guides' => 'guides' } attr_reader :component, :options @@ -35,7 +37,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 @@ -47,6 +53,7 @@ class Build heading = [gem] heading << "with #{adapter}" if activerecord? heading << "in isolation" if isolated? + heading << "integration" if integration? heading.join(' ') end @@ -54,7 +61,7 @@ class Build if activerecord? ['db:mysql:rebuild', "#{adapter}:#{'isolated_' if isolated?}test"] else - ["test#{':isolated' if isolated?}"] + ["test", ('isolated' if isolated?), ('integration' if integration?)].compact.join(":") end end @@ -69,10 +76,18 @@ class Build gem == 'activerecord' end + def guides? + gem == 'guides' + end + def isolated? options[:isolated] end + def integration? + component.split(':').last == 'integration' + end + def gem MAP[component.split(':').first] end @@ -90,13 +105,27 @@ class Build end true 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' + ENV['QC_DATABASE_URL'] = 'postgres://postgres@localhost/active_jobs_qc_int_test' + ENV['QUE_DATABASE_URL'] = 'postgres://postgres@localhost/active_jobs_que_int_test' end results = {} 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 == 'aj:integration' && isolated + next if gem == 'guides' && isolated build = Build.new(gem, :isolated => isolated) results[build.key] = build.run! @@ -127,6 +156,6 @@ if failures.empty? else puts puts "Rails build FAILED" - puts "Failed components: #{failures.map { |component| component.first }.join(', ')}" + puts "Failed components: #{failures.map(&:first).join(', ')}" exit(false) end |