Module: Julewire::Core::Testing::TestReports
- Defined in:
- lib/julewire/core/testing/test_reports.rb
Class Method Summary collapse
- .junit_reporter_class ⇒ Object
- .start!(enabled: ENV.fetch("JULEWIRE_JUNIT", nil), reports_dir: ENV.fetch("JULEWIRE_JUNIT_DIR", "test/reports")) ⇒ Object
Class Method Details
.junit_reporter_class ⇒ Object
70 71 72 73 74 |
# File 'lib/julewire/core/testing/test_reports.rb', line 70 def junit_reporter_class @junit_reporter_class ||= Class.new(Minitest::Reporters::JUnitReporter) do include CodecovJUnitReportMethods end end |
.start!(enabled: ENV.fetch("JULEWIRE_JUNIT", nil), reports_dir: ENV.fetch("JULEWIRE_JUNIT_DIR", "test/reports")) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/julewire/core/testing/test_reports.rb', line 47 def start!(enabled: ENV.fetch("JULEWIRE_JUNIT", nil), reports_dir: ENV.fetch("JULEWIRE_JUNIT_DIR", "test/reports")) return unless enabled require "fileutils" require "minitest/reporters" FileUtils.mkdir_p(reports_dir) junit = junit_reporter_class.new( reports_dir, true, base_path: Dir.pwd, include_timestamp: true, single_file: true ) Minitest::Reporters.use!( [Minitest::Reporters::DefaultReporter.new, junit], ENV, Minitest.backtrace_filter ) end |