diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-24 10:45:39 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-24 10:45:39 +0000 |
commit | 52387b65fa68bf617d10fcc7b2ea3f0f5b10775a (patch) | |
tree | e4fdaec3277fd4b558f8557416fc723a12da0783 /lib | |
parent | 71cfbe7780e9f262eccac834577af2fd688abfe3 (diff) |
Simplify test-execution logic, and count the test-runs from 1 rather than zero.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/custodian/worker.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb index 05049ea..9c9e8ec 100644 --- a/lib/custodian/worker.rb +++ b/lib/custodian/worker.rb @@ -89,7 +89,7 @@ module Custodian # def log_message( msg ) @logger.info( msg ) - puts msg if ( ENV['VERBOSE'] ) + puts msg end @@ -139,11 +139,9 @@ module Custodian # - # Did the test succeed? If not count the number of times it failed in - # a row. We'll repeat several times + # The count of times this test has run. # - success = false - count = 0 + count = 1 # @@ -165,7 +163,7 @@ module Custodian # # We stop the execution on a single success. # - while ( ( count < @retry_count ) && ( success == false ) ) + while ( ( count < @retry_count ) && ( result == false ) ) log_message( "Running test - [#{count}/#{@retry_count}]" ) @@ -179,7 +177,6 @@ module Custodian log_message( "Test succeeed - clearing alert" ) success = true alert.clear() - result = true end count += 1 end @@ -187,7 +184,7 @@ module Custodian # # If we didn't succeed on any of the attempts raise the alert. # - if ( ! success ) + if ( ! result ) # # Raise the alert, passing the error message. |