Class: Minitest::Reporters::RedisReporter::Base

Inherits:
BaseReporter
  • Object
show all
Defined in:
lib/minitest/reporters/redis_reporter.rb

Direct Known Subclasses

Summary, Worker

Instance Method Summary collapse

Constructor Details

#initialize(redis:, build_id:, **options) ⇒ Base

Returns a new instance of Base.



56
57
58
59
60
# File 'lib/minitest/reporters/redis_reporter.rb', line 56

def initialize(redis:, build_id:, **options)
  @redis = redis
  @key = "build:#{build_id}"
  super(options)
end

Instance Method Details

#completed? ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/minitest/reporters/redis_reporter.rb', line 70

def completed?
  total > 0 && total == processed
end

#error_reports ⇒ Object



74
75
76
# File 'lib/minitest/reporters/redis_reporter.rb', line 74

def error_reports
  redis.hgetall(key('error-reports')).sort_by(&:first).map { |k, v| Error.load(v) }
end

#processed ⇒ Object



66
67
68
# File 'lib/minitest/reporters/redis_reporter.rb', line 66

def processed
  redis.get(key('processed')).to_i
end

#total ⇒ Object



62
63
64
# File 'lib/minitest/reporters/redis_reporter.rb', line 62

def total
  redis.get(key('total')).to_i
end