Output junit format test report

This commit is contained in:
Fumiaki MATSUSHIMA 2019-03-25 02:59:28 +09:00
parent 39d42dbde2
commit 61c4be4777
16 changed files with 48 additions and 0 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ package-lock.json
pkg/
/tmp/
/yarn-error.log
/test-reports/

View File

@ -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"

View File

@ -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)
@ -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)
@ -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)

View File

@ -41,3 +41,5 @@ class ActionCable::TestCase < ActiveSupport::TestCase
end
end
end
require_relative "../../tools/test_common"

View File

@ -54,3 +54,5 @@ class BounceMailer < ActionMailer::Base
end
end
end
require_relative "../../tools/test_common"

View File

@ -49,3 +49,5 @@ class ActiveSupport::TestCase
skip message if defined?(JRUBY_VERSION)
end
end
require_relative "../../tools/test_common"

View File

@ -382,3 +382,5 @@ end
class DrivenBySeleniumWithHeadlessFirefox < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_firefox
end
require_relative "../../tools/test_common"

View File

@ -31,3 +31,5 @@ class ActiveSupport::TestCase
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"

View File

@ -205,3 +205,5 @@ class ActiveSupport::TestCase
skip message if defined?(JRUBY_VERSION)
end
end
require_relative "../../tools/test_common"

View File

@ -16,3 +16,5 @@ else
end
require "active_support/testing/autorun"
require_relative "../../tools/test_common"

View File

@ -25,3 +25,5 @@ class ActiveModel::TestCase < ActiveSupport::TestCase
skip message if defined?(JRUBY_VERSION)
end
end
require_relative "../../../tools/test_common"

View File

@ -202,3 +202,5 @@ module InTimeZone
ActiveRecord::Base.time_zone_aware_attributes = old_tz
end
end
require_relative "../../../tools/test_common"

View File

@ -101,3 +101,5 @@ end
class Group < ActiveRecord::Base
has_one_attached :avatar
end
require_relative "../../tools/test_common"

View File

@ -40,3 +40,5 @@ class ActiveSupport::TestCase
skip message if defined?(JRUBY_VERSION)
end
end
require_relative "../../tools/test_common"

View File

@ -32,3 +32,5 @@ class ActiveSupport::TestCase
skip message if defined?(JRUBY_VERSION)
end
end
require_relative "../../tools/test_common"

15
tools/test_common.rb Normal file
View File

@ -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