Skip to content

Commit 5d6db26

Browse files
committed
Changed the output of the ruby command
1 parent 574131b commit 5d6db26

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

ruby/bin/annotate

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -74,36 +74,29 @@ junit_report_files.sort.each do |file|
7474
end
7575

7676
STDERR.puts "--- ✍️ Preparing annotation"
77-
STDERR.puts "#{testcases} testcases found"
78-
79-
if failures.any?
80-
STDERR.puts "There #{failures.length == 1 ? "is 1 failure/error" : "are #{failures.length} failures/errors" } 😭"
81-
82-
failures_count = failures.select {|f| f.type == :failure }.length
83-
errors_count = failures.select {|f| f.type == :error }.length
84-
puts [
85-
failures_count == 0 ? nil : (failures_count == 1 ? "1 failure" : "#{failures_count} failures"),
86-
errors_count === 0 ? nil : (errors_count == 1 ? "1 error" : "#{errors_count} errors"),
87-
].compact.join(" and ") + ":\n\n"
88-
89-
failures.each do |failure|
90-
puts "<details>"
91-
puts "<summary><code>#{failure.name} in #{failure.unit_name}</code></summary>\n\n"
92-
if failure.message
93-
puts "<p>#{failure.message.chomp.strip}</p>\n\n"
94-
end
95-
if failure.body
96-
puts "<pre><code>#{CGI.escapeHTML(failure.body.chomp.strip)}</code></pre>\n\n"
97-
end
98-
if failure.job
99-
puts "in <a href=\"##{failure.job}\">Job ##{failure.job}</a>"
100-
end
101-
puts "</details>"
102-
puts "" unless failure == failures.last
103-
end
10477

105-
else
106-
STDERR.puts "There were no failures/errors 🙌"
78+
failures_count = failures.select {|f| f.type == :failure }.length
79+
errors_count = failures.select {|f| f.type == :error }.length
80+
81+
puts "Failures: #{failures_count}"
82+
puts "Errors: #{errors_count}"
83+
puts "Total tests: #{testcases}"
84+
puts "\n"
85+
86+
failures.each do |failure|
87+
puts "<details>"
88+
puts "<summary><code>#{failure.name} in #{failure.unit_name}</code></summary>\n\n"
89+
if failure.message
90+
puts "<p>#{failure.message.chomp.strip}</p>\n\n"
91+
end
92+
if failure.body
93+
puts "<pre><code>#{CGI.escapeHTML(failure.body.chomp.strip)}</code></pre>\n\n"
94+
end
95+
if failure.job
96+
puts "in <a href=\"##{failure.job}\">Job ##{failure.job}</a>"
97+
end
98+
puts "</details>"
99+
puts "" unless failure == failures.last
107100
end
108101

109102
if report_slowest > 0

0 commit comments

Comments
 (0)