mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add the bug report templates to the Travis CI build
The bug report templates are now executed from the `ci/travis.rb` when `GEM` contains `guides`. I started by creating a `test` task in `guides/Rakefile` to handle this, but since inline `gemfile` must not be executed with `bundle exec`, that rake task would not be consistent with others. So I went back by executing them directly from `Build`. Use inline Gemfile dependency when reporting gem bugs
This commit is contained in:
parent
423f14183f
commit
89550bc1a0
6 changed files with 49 additions and 17 deletions
|
@ -19,6 +19,7 @@ env:
|
||||||
- "GEM=ar:sqlite3"
|
- "GEM=ar:sqlite3"
|
||||||
- "GEM=ar:postgresql"
|
- "GEM=ar:postgresql"
|
||||||
- "GEM=aj:integration"
|
- "GEM=aj:integration"
|
||||||
|
- "GEM=guides"
|
||||||
rvm:
|
rvm:
|
||||||
- 2.2.2
|
- 2.2.2
|
||||||
- ruby-head
|
- ruby-head
|
||||||
|
|
18
ci/travis.rb
18
ci/travis.rb
|
@ -22,7 +22,8 @@ class Build
|
||||||
'as' => 'activesupport',
|
'as' => 'activesupport',
|
||||||
'ar' => 'activerecord',
|
'ar' => 'activerecord',
|
||||||
'av' => 'actionview',
|
'av' => 'actionview',
|
||||||
'aj' => 'activejob'
|
'aj' => 'activejob',
|
||||||
|
'guides' => 'guides'
|
||||||
}
|
}
|
||||||
|
|
||||||
attr_reader :component, :options
|
attr_reader :component, :options
|
||||||
|
@ -36,9 +37,13 @@ class Build
|
||||||
self.options.update(options)
|
self.options.update(options)
|
||||||
Dir.chdir(dir) do
|
Dir.chdir(dir) do
|
||||||
announce(heading)
|
announce(heading)
|
||||||
|
if guides?
|
||||||
|
run_bug_report_templates
|
||||||
|
else
|
||||||
rake(*tasks)
|
rake(*tasks)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def announce(heading)
|
def announce(heading)
|
||||||
puts "\n\e[1;33m[Travis CI] #{heading}\e[m\n"
|
puts "\n\e[1;33m[Travis CI] #{heading}\e[m\n"
|
||||||
|
@ -71,6 +76,10 @@ class Build
|
||||||
gem == 'activerecord'
|
gem == 'activerecord'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def guides?
|
||||||
|
gem == 'guides'
|
||||||
|
end
|
||||||
|
|
||||||
def isolated?
|
def isolated?
|
||||||
options[:isolated]
|
options[:isolated]
|
||||||
end
|
end
|
||||||
|
@ -96,6 +105,12 @@ class Build
|
||||||
end
|
end
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def run_bug_report_templates
|
||||||
|
Dir.glob('bug_report_templates/*.rb').all? do |file|
|
||||||
|
system(Gem.ruby, '-w', file)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ENV['GEM']=='aj:integration'
|
if ENV['GEM']=='aj:integration'
|
||||||
|
@ -110,6 +125,7 @@ ENV['GEM'].split(',').each do |gem|
|
||||||
next if ENV['TRAVIS_PULL_REQUEST'] && ENV['TRAVIS_PULL_REQUEST'] != 'false' && isolated
|
next if ENV['TRAVIS_PULL_REQUEST'] && ENV['TRAVIS_PULL_REQUEST'] != 'false' && isolated
|
||||||
next if gem == 'railties' && isolated
|
next if gem == 'railties' && isolated
|
||||||
next if gem == 'aj:integration' && isolated
|
next if gem == 'aj:integration' && isolated
|
||||||
|
next if gem == 'guides' && isolated
|
||||||
|
|
||||||
build = Build.new(gem, :isolated => isolated)
|
build = Build.new(gem, :isolated => isolated)
|
||||||
results[build.key] = build.run!
|
results[build.key] = build.run!
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
# Activate the gem you are reporting the issue against.
|
require 'bundler/inline'
|
||||||
gem 'rails', '4.2.0'
|
|
||||||
|
gemfile(true) do
|
||||||
|
source 'https://rubygems.org'
|
||||||
|
# Activate the gem you are reporting the issue against.
|
||||||
|
gem 'rails', '4.2.0'
|
||||||
|
end
|
||||||
|
|
||||||
require 'rails'
|
|
||||||
require 'rack/test'
|
require 'rack/test'
|
||||||
require 'action_controller/railtie'
|
require 'action_controller/railtie'
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ gemfile(true) do
|
||||||
gem 'arel', github: 'rails/arel'
|
gem 'arel', github: 'rails/arel'
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'rails'
|
|
||||||
require 'action_controller/railtie'
|
require 'action_controller/railtie'
|
||||||
|
|
||||||
class TestApp < Rails::Application
|
class TestApp < Rails::Application
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# Activate the gem you are reporting the issue against.
|
require 'bundler/inline'
|
||||||
gem 'activerecord', '4.2.0'
|
|
||||||
|
gemfile(true) do
|
||||||
|
source 'https://rubygems.org'
|
||||||
|
# Activate the gem you are reporting the issue against.
|
||||||
|
gem 'activerecord', '4.2.0'
|
||||||
|
gem 'sqlite3'
|
||||||
|
end
|
||||||
|
|
||||||
require 'active_record'
|
require 'active_record'
|
||||||
require 'minitest/autorun'
|
require 'minitest/autorun'
|
||||||
require 'logger'
|
require 'logger'
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
# Activate the gems you are reporting the issue against.
|
require 'bundler/inline'
|
||||||
gem 'activesupport', '4.2.0'
|
|
||||||
require 'active_support'
|
gemfile(true) do
|
||||||
|
source 'https://rubygems.org'
|
||||||
|
# Activate the gem you are reporting the issue against.
|
||||||
|
gem 'activesupport', '4.2.0'
|
||||||
|
end
|
||||||
|
|
||||||
require 'active_support/core_ext/object/blank'
|
require 'active_support/core_ext/object/blank'
|
||||||
require 'minitest/autorun'
|
require 'minitest/autorun'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue