-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
f3be1e5
commit 08097fb
Showing
2 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
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 |