aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2015-09-18 10:28:13 +0100
committerMike McQuaid2015-09-18 10:28:35 +0100
commit07e550d525ffc3ff42e287b3d7b33780cd4fef12 (patch)
tree21410169565d4624b04b3930f1d78932073c6b6a /Library
parent4d83331c51c589b89a6e2948afc5d3fb94754c9e (diff)
downloadbrew-07e550d525ffc3ff42e287b3d7b33780cd4fef12.tar.bz2
test-bot: unify, fix Travis and Jenkins output.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/test-bot.rb46
1 files changed, 11 insertions, 35 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index eae6cd125..b0a3f6445 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -66,18 +66,6 @@ module Homebrew
root ? root + file : file
end
- def status_colour
- case @status
- when :passed then "green"
- when :running then "orange"
- when :failed then "red"
- end
- end
-
- def status_upcase
- @status.to_s.upcase
- end
-
def command_short
(@command - %w[brew --force --retry --verbose --build-bottle --rb]).join(" ")
end
@@ -91,33 +79,25 @@ module Homebrew
end
def puts_command
- cmd = @command.join(" ")
- cmd_line = "#{Tty.blue}==>#{Tty.white} #{cmd}#{Tty.reset}"
if ENV["TRAVIS"]
@travis_timer_id = rand(2**32).to_s(16)
puts "travis_fold:start:#{@command.join(".")}"
puts "travis_time:start:#{@travis_timer_id}"
- puts cmd_line
- return
end
- print cmd_line
- tabs = (80 - "PASSED".length + 1 - cmd.length) / 8
- tabs.times { print "\t" }
- $stdout.flush
+ puts "#{Tty.blue}==>#{Tty.white} #{@command.join(" ")}#{Tty.reset}"
end
def puts_result
if ENV["TRAVIS"]
- cmd = @command.join(" ")
- puts "#{Tty.send status_colour}==> #{cmd}: #{status_upcase}#{Tty.reset}"
travis_start_time = @start_time.to_i*1000000000
travis_end_time = @end_time.to_i*1000000000
travis_duration = travis_end_time - travis_start_time
puts "travis_fold:end:#{@command.join(".")}"
puts "travis_time:end:#{@travis_timer_id},start=#{travis_start_time},finish=#{travis_end_time},duration=#{travis_duration}"
- return
end
- puts " #{Tty.send status_colour}#{status_upcase}#{Tty.reset}"
+ if @status == :failed || true
+ puts "#{Tty.red}==> FAILED:#{Tty.white} #{@command.join(" ")}#{Tty.reset}"
+ end
end
def has_output?
@@ -972,19 +952,15 @@ module Homebrew
end
end
- failed_steps = []
- tests.each do |test|
- test.steps.each do |step|
- next if step.passed?
- failed_steps << step.command_short
+ if ARGV.include? "--email"
+ failed_steps = []
+ tests.each do |test|
+ test.steps.each do |step|
+ next if step.passed?
+ failed_steps << step.command_short
+ end
end
- end
-
- if ENV["TRAVIS"] && !failed_steps.empty?
- puts "#{Tty.red}==> #{cmd}: FAILED: #{MacOS.version}: #{failed_steps.join ", "}#{Tty.reset}"
- end
- if ARGV.include? "--email"
if failed_steps.empty?
email_subject = ""
else