Fix message displayed when running tests

Used to show Deploy FAILURE for successful test runs
Small bump of version too
This commit is contained in:
ViViDboarder 2013-08-21 16:28:46 -07:00
parent 2dd2d50781
commit 3e21b34664
2 changed files with 47 additions and 39 deletions

View File

@ -106,8 +106,38 @@ module AbuseTheForce
result = job.result
if result != nil
# Check if this was a test execution
if result.run_test_result != nil
# Display a quick Success or Failure
puts "\nTests #{result.run_test_result.num_failures == "0" ? "SUCCESS" : "FAILURE"}"
# Display overview of number of successes and failures
puts "TESTS RUN: #{result.run_test_result.num_tests_run} FAILURES: #{result.run_test_result.num_failures}"
if result.run_test_result.failures != nil
# Make sure failures is an array
unless result.run_test_result.failures.kind_of? Array
result.run_test_result.failures = [].push result.run_test_result.failures
end
result.run_test_result.failures.each do |m|
# Print our error in teh format "filename:line:column type in object message"
if !m.success
puts "#{m.name}.#{m.method_name}: #{m.message}"
puts "Stack Trace: #{m.stack_trace}"
puts ""
end # not success
end # loop through test faiulres
end # failures != nil
else # run_test_result != nil
puts "\nDeploy #{result.success ? "SUCCESS" : "FAILURE"}"
# Not a test execution, so deployment
# If a failed deploy, print errors
if result.success == false
@ -130,31 +160,9 @@ module AbuseTheForce
puts "#{m.file_name}:#{m.line_number}:#{m.column_number} #{m.problem_type} in #{m.full_name} #{m.problem}"
end
end
# Need messages in an array
if result.run_test_result != nil
puts "TESTS RUN: #{result.run_test_result.num_tests_run} FAILURES: #{result.run_test_result.num_failures}"
if result.run_test_result.failures != nil
unless result.run_test_result.failures.kind_of? Array
result.run_test_result.failures = [].push result.run_test_result.failures
end
result.run_test_result.failures.each do |m|
# Print our error in teh format "filename:line:column type in object message"
if !m.success
puts "#{m.name}.#{m.method_name}: #{m.message}"
puts "Stack Trace: #{m.stack_trace}"
puts ""
end
end
end
end
end
end
end # success == false
end # end result.run_test_result != null else
end # result != nil
}.
on_error { |job| puts "Something bad happened!" }.
on_poll { |job| puts "Polling for #{job.id}!" }.

View File

@ -1,3 +1,3 @@
module AbuseTheForce
VERSION = '0.1.2'
VERSION = '0.1.3'
end