Class: TestQueue::Runner::TestUnit

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

Defined Under Namespace

Classes: IteratorWrapper, TestSuite

Constant Summary

Constants inherited from TestQueue::Runner

MiniTest, TOKEN_REGEX

Instance Attribute Summary

Attributes inherited from TestQueue::Runner

#concurrency, #exit_when_done, #stats

Instance Method Summary collapse

Methods inherited from TestQueue::Runner

#abort, #after_fork, #after_fork_internal, #around_filter, #awaiting_suites?, #cleanup_worker, #collect_worker_data, #connect_to_relay, #discover_suites, #distribute_queue, #enqueue_discovered_suite, #execute, #execute_internal, #kill_subprocesses, #kill_suite_discovery_process, #kill_workers, #prepare, #queue_status, #reap_suite_discovery_process, #reap_workers, #relay?, #relay_to_master, #spawn_workers, #start_master, #start_relay, #stats_file, #stop_master, #summarize, #summarize_internal, #worker_completed

Constructor Details

#initializeTestUnit

Returns a new instance of TestUnit.



53
54
55
# File 'lib/test_queue/runner/testunit.rb', line 53

def initialize
  super(TestFramework::TestUnit.new)
end

Instance Method Details

#run_worker(iterator) ⇒ Object



57
58
59
60
61
# File 'lib/test_queue/runner/testunit.rb', line 57

def run_worker(iterator)
  @suite = TestSuite.new('specified by test-queue master', iterator)
  res = Test::Unit::UI::Console::TestRunner.new(@suite).start
  res.run_count - res.pass_count
end

#summarize_worker(worker) ⇒ Object



63
64
65
66
# File 'lib/test_queue/runner/testunit.rb', line 63

def summarize_worker(worker)
  worker.summary = worker.output.split("\n").grep(/^\d+ tests?/).first
  worker.failure_output = worker.output.scan(/^Failure:[^\n]*\n(.*?)\n=======================*/m).join("\n")
end