Class: Minitest::Reporters::RedisReporter::Worker
- Defined in:
- lib/minitest/reporters/redis_reporter.rb
Instance Attribute Summary collapse
-
#requeues ⇒ Object
Returns the value of attribute requeues.
Instance Method Summary collapse
-
#initialize(worker_id:, **options) ⇒ Worker
constructor
A new instance of Worker.
- #record(test) ⇒ Object
- #report ⇒ Object
Methods inherited from Base
#completed?, #error_reports, #processed, #total
Constructor Details
#initialize(worker_id:, **options) ⇒ Worker
Returns a new instance of Worker.
191 192 193 194 195 196 197 198 |
# File 'lib/minitest/reporters/redis_reporter.rb', line 191 def initialize(worker_id:, **) super @worker_id = worker_id self.failures = 0 self.errors = 0 self.skips = 0 self.requeues = 0 end |
Instance Attribute Details
#requeues ⇒ Object
Returns the value of attribute requeues.
189 190 191 |
# File 'lib/minitest/reporters/redis_reporter.rb', line 189 def requeues @requeues end |
Instance Method Details
#record(test) ⇒ Object
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/minitest/reporters/redis_reporter.rb', line 204 def record(test) super self.total_time = Minitest.clock_time - start_time if test.requeued? self.requeues += 1 elsif test.skipped? self.skips += 1 elsif test.error? self.errors += 1 elsif test.failure self.failures += 1 end redis.multi do if (test.failure || test.error?) && !test.skipped? redis.hset(key('error-reports'), "#{test.klass}##{test.name}", dump(test)) else redis.hdel(key('error-reports'), "#{test.klass}##{test.name}") end COUNTERS.each do |counter| redis.hset(key(counter), worker_id, send(counter)) end end end |
#report ⇒ Object
200 201 202 |
# File 'lib/minitest/reporters/redis_reporter.rb', line 200 def report # noop end |