29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'lib/hoopla_salesforce/text_reporter.rb', line 29
def report
indent = " "
updated_files = []
problems = []
test_failures = []
coverage_warnings = []
sanitize(result[:messages]).each do |message|
if message[:success]
status = " "
status = "U" if message[:changed]
status = "D" if message[:deleted]
status = "A" if message[:created]
updated_files << "#{green}#{indent}#{status} #{message[:file_name]}#{end_color}"
end
if message[:problem]
problem = "#{red}#{indent}#{message[:file_name]}:#{message[:line_number]} (column #{message[:column_number]})\n"
problem += "#{indent*2}#{message[:problem]}#{end_color}"
problems << problem
end
end
if ENV['FULL_OUTPUT']
pp result
else
puts "(Run with FULL_OUTPUT=true to show full deploy output)"
end
puts
puts "Updated files:"
puts updated_files.uniq.join("\n")
puts
puts "Test results:"
test_result = result[:run_test_result]
failures = test_result[:num_failures].to_i
passes = test_result[:num_tests_run].to_i - failures
passes = 0 if passes < 0
print "#{indent}Passes: #{green}#{passes}#{end_color} "
print "Failures: #{red}#{failures}#{end_color} "
puts "Duration: #{test_result[:total_time]}"
puts
sanitize(test_result[:failures]).each do |failure|
message = "#{indent}#{red}#{failure[:name]}.#{failure[:method_name]}: #{failure[:message]}\n"
message += failure[:stack_trace].split("\n").map{ |l| indent * 2 + l }.join("\n") if failure[:stack_trace]
message += end_color
test_failures << message
end
if !test_failures.empty?
puts "Test failures:"
puts test_failures.join("\n")
puts
end
sanitize(test_result[:code_coverage_warnings]).each do |warning|
coverage_warnings << "#{indent}#{warning[:name]}: #{warning[:message]}"
end
if !coverage_warnings.empty?
puts "Coverage warnings:"
puts coverage_warnings.join("\n")
puts
end
if !problems.empty?
puts "Problems:"
puts problems.join("\n")
puts
end
return problems.empty?
end
|