Class: TestQueue::Runner::Sample

Inherits:
TestQueue::Runner show all
Defined in:
lib/test_queue/runner/sample.rb

Instance Attribute Summary

Attributes inherited from TestQueue::Runner

#concurrency

Instance Method Summary collapse

Methods inherited from TestQueue::Runner

#after_fork_internal, #around_filter, #cleanup_worker, #connect_to_relay, #distribute_queue, #execute, #execute_parallel, #execute_sequential, #initialize, #prepare, #reap_worker, #relay?, #relay_to_master, #start_master, #stats, #stats_file, #stop_master, #summarize, #summarize_internal, #worker_completed

Constructor Details

This class inherits a constructor from TestQueue::Runner

Instance Method Details

#after_fork(num) ⇒ Object



12
13
14
15
# File 'lib/test_queue/runner/sample.rb', line 12

def after_fork(num)
  puts "  -- worker #{num} booted as pid #{$$}"
  super
end

#run_worker(iterator) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/test_queue/runner/sample.rb', line 17

def run_worker(iterator)
  sum = 0
  iterator.each do |item|
    puts "  #{item.inspect}"
    sum += item
  end
  sum
end

#spawn_workersObject



7
8
9
10
# File 'lib/test_queue/runner/sample.rb', line 7

def spawn_workers
  puts "Spawning #@concurrency workers"
  super
end

#summarize_worker(worker) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/test_queue/runner/sample.rb', line 26

def summarize_worker(worker)
  stats.update(worker.stats)

  summary  = worker.output.scan(/^\s*(\d+)/).join(', ')
  failures = ''

  [ summary, failures ]
end