Skip to content

Commit

Permalink
TestRun#errors? and TestRun#aborted? now always ask redis
Browse files Browse the repository at this point in the history
when a job catches an exception we set errored in the test run
  • Loading branch information
Jared Grippe authored and jaredatron committed May 17, 2012
1 parent c8f90d2 commit 5e55e9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/hobson/project/test_run/job/actions.rb
Expand Up @@ -54,6 +54,7 @@ def run_tests!
end

rescue Object => e
test_run.errored!
logger.info %(Exception:\n#{e}\n#{e.backtrace.join("\n")})
self['exception'] = e.to_s
self['exception:class'] = e.class.to_s
Expand Down
4 changes: 2 additions & 2 deletions lib/hobson/project/test_run/status.rb
Expand Up @@ -24,15 +24,15 @@ def status

def aborted?
# bypass the redis_hash cache and read from redis every time
@aborted ||= redis_hash.get('aborted_at').present?
redis_hash.get('aborted_at').present?
end

def running?
!complete? && jobs.present? && jobs.any?(&:running?)
end

def errored?
errored_at.present? || jobs.any?(&:errored?)
redis_hash.get("errored_at").present? || jobs.any?(&:errored?)
end

def complete?
Expand Down

0 comments on commit 5e55e9b

Please sign in to comment.