Skip to content

Commit

Permalink
Merge pull request #35698 from mtsmfm/output-test-report
Browse files Browse the repository at this point in the history
Output junit format test report
  • Loading branch information
matthewd committed Apr 4, 2019
2 parents c9981ae + 61c4be4 commit fd81e83
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@ package-lock.json
pkg/
/tmp/
/yarn-error.log
/test-reports/
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -102,6 +102,7 @@ instance_eval File.read local_gemfile if File.exist? local_gemfile
group :test do
gem "minitest-bisect"
gem "minitest-retry"
gem "minitest-reporters"

platforms :mri do
gem "stackprof"
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Expand Up @@ -111,6 +111,7 @@ GEM
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
amq-protocol (2.3.0)
ansi (1.5.0)
ast (2.4.0)
aws-eventstream (1.0.1)
aws-partitions (1.111.0)
Expand Down Expand Up @@ -316,6 +317,11 @@ GEM
minitest-bisect (1.4.0)
minitest-server (~> 1.0)
path_expander (~> 1.0)
minitest-reporters (1.3.6)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
minitest-retry (0.1.9)
minitest (>= 5.0)
minitest-server (1.0.5)
Expand Down Expand Up @@ -555,6 +561,7 @@ DEPENDENCIES
libxml-ruby
listen (>= 3.0.5, < 3.2)
minitest-bisect
minitest-reporters
minitest-retry
mysql2 (>= 0.4.10)
nokogiri (>= 1.8.1)
Expand Down
2 changes: 2 additions & 0 deletions actioncable/test/test_helper.rb
Expand Up @@ -41,3 +41,5 @@ def wait_for_executor(executor)
end
end
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions actionmailbox/test/test_helper.rb
Expand Up @@ -54,3 +54,5 @@ def bounce(to:)
end
end
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions actionmailer/test/abstract_unit.rb
Expand Up @@ -49,3 +49,5 @@ def jruby_skip(message = "")
skip message if defined?(JRUBY_VERSION)
end
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions actionpack/test/abstract_unit.rb
Expand Up @@ -382,3 +382,5 @@ class DrivenBySeleniumWithHeadlessChrome < ActionDispatch::SystemTestCase
class DrivenBySeleniumWithHeadlessFirefox < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_firefox
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions actiontext/test/test_helper.rb
Expand Up @@ -31,3 +31,5 @@ def create_file_blob(filename:, content_type:, metadata: nil)
ActiveStorage::Blob.create_after_upload! io: file_fixture(filename).open, filename: filename, content_type: content_type, metadata: metadata
end
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions actionview/test/abstract_unit.rb
Expand Up @@ -205,3 +205,5 @@ def jruby_skip(message = "")
skip message if defined?(JRUBY_VERSION)
end
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions activejob/test/helper.rb
Expand Up @@ -16,3 +16,5 @@
end

require "active_support/testing/autorun"

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions activemodel/test/cases/helper.rb
Expand Up @@ -25,3 +25,5 @@ def jruby_skip(message = "")
skip message if defined?(JRUBY_VERSION)
end
end

require_relative "../../../tools/test_common"
2 changes: 2 additions & 0 deletions activerecord/test/cases/helper.rb
Expand Up @@ -202,3 +202,5 @@ def in_time_zone(zone)
ActiveRecord::Base.time_zone_aware_attributes = old_tz
end
end

require_relative "../../../tools/test_common"
2 changes: 2 additions & 0 deletions activestorage/test/test_helper.rb
Expand Up @@ -101,3 +101,5 @@ class User < ActiveRecord::Base
class Group < ActiveRecord::Base
has_one_attached :avatar
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions activesupport/test/abstract_unit.rb
Expand Up @@ -40,3 +40,5 @@ def jruby_skip(message = "")
skip message if defined?(JRUBY_VERSION)
end
end

require_relative "../../tools/test_common"
2 changes: 2 additions & 0 deletions railties/test/abstract_unit.rb
Expand Up @@ -32,3 +32,5 @@ def jruby_skip(message = "")
skip message if defined?(JRUBY_VERSION)
end
end

require_relative "../../tools/test_common"
15 changes: 15 additions & 0 deletions tools/test_common.rb
@@ -0,0 +1,15 @@
if ENV["BUILDKITE"]
require "minitest/reporters"
require "fileutils"

module Minitest
def self.plugin_rails_ci_junit_format_test_report_for_buildkite_init(*)
dir = File.join(__dir__, "../test-reports/#{ENV['BUILDKITE_JOB_ID']}")
reporter << Minitest::Reporters::JUnitReporter.new(dir, false)
FileUtils.mkdir_p(dir)
end
end

Minitest.load_plugins
Minitest.extensions.unshift "rails_ci_junit_format_test_report_for_buildkite"
end

0 comments on commit fd81e83

Please sign in to comment.