Class: StatsdTestHarness::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/statsd_test_harness/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path_to_config) ⇒ Processor

Returns a new instance of Processor.



8
9
10
11
# File 'lib/statsd_test_harness/processor.rb', line 8

def initialize(path_to_config)
  @path_to_config = path_to_config
  load_config
end

Instance Attribute Details

#path_to_configObject (readonly)

Returns the value of attribute path_to_config.



6
7
8
# File 'lib/statsd_test_harness/processor.rb', line 6

def path_to_config
  @path_to_config
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/statsd_test_harness/processor.rb', line 13

def run
  StatsdTestHarness.config.tools.each do |tool_harness|
    tool = Tool.new(tool_harness)
    puts "Executing #{tool.name} test suite for #{StatsdTestHarness.config.app_name}..."
    exit_status, duration = with_timing{tool.run}
    success = exit_status.to_i == 0
    StatsdTestHarness::Client.new.post(duration, tool.name, success, !tool.ignore_return_value)
    puts "Test suite for #{tool.name} completed in #{duration} ms."
    unless success || tool.ignore_return_value
      exit exit_status
    end
  end
end