aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2019-04-04 21:57:41 +1030
committerGitHub <noreply@github.com>2019-04-04 21:57:41 +1030
commitfd81e83be7a6fcaa34467ff3d01ab6f66c922d6c (patch)
tree80bff03a8f2a17ad2bca9d7bbce02a8f55f40050 /tools
parentc9981ae6e022023a46dbab2ace62f7eb256a0816 (diff)
parent61c4be477706b721688e36a3168f86aabc625658 (diff)
downloadrails-fd81e83be7a6fcaa34467ff3d01ab6f66c922d6c.tar.gz
rails-fd81e83be7a6fcaa34467ff3d01ab6f66c922d6c.tar.bz2
rails-fd81e83be7a6fcaa34467ff3d01ab6f66c922d6c.zip
Merge pull request #35698 from mtsmfm/output-test-report
Output junit format test report
Diffstat (limited to 'tools')
-rw-r--r--tools/test_common.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/test_common.rb b/tools/test_common.rb
new file mode 100644
index 0000000000..7f59caf644
--- /dev/null
+++ b/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