Revision 08097fb6
Added by Ewoud Kohl van Wijngaarden 4 months ago
test/test_report_helper.rb | ||
---|---|---|
require 'minitest/reporters'
|
||
|
||
junit_reporter = Minitest::Reporters::JUnitReporter.new('jenkins/reports/unit/')
|
||
meantime_reporter = Minitest::Reporters::MeanTimeReporter.new(previous_runs_filename: Rails.root.join('tmp', 'foreman_minitest_reporters_previous_run'),
|
||
report_filename: Rails.root.join('tmp', 'foreman_minitest_reporters_report'))
|
||
if ENV['GITHUB_ACTIONS'] == 'true'
|
||
require 'minitest_reporters_github'
|
||
reporters = [MinitestReportersGithub.new]
|
||
else
|
||
reporters = [
|
||
Minitest::Reporters::JUnitReporter.new('jenkins/reports/unit/'),
|
||
Minitest::Reporters::MeanTimeReporter.new(
|
||
previous_runs_filename: Rails.root.join('tmp', 'foreman_minitest_reporters_previous_run'),
|
||
report_filename: Rails.root.join('tmp', 'foreman_minitest_reporters_report')
|
||
),
|
||
]
|
||
end
|
||
|
||
Minitest::Reporters.use! [junit_reporter, meantime_reporter]
|
||
Minitest::Reporters.use! reporters
|
Also available in: Unified diff
Fixes #37092 - Use minitest_reporters_github in GHA
This is a specialized reporter to provide GitHub annotations on failure.
These annotations can be seen in the changes files tab.