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 | 7e3d7759c91c95fa41a24ca4143d1caf2a9e2771 (patch) | |
tree | e4fdaec3277fd4b558f8557416fc723a12da0783 | |
parent | 01e9e0ecd4e5ea4fab4a84fd70816ec65886279e (diff) |
Simplify test-execution logic, and count the test-runs from 1 rather than zero.
-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. |