class ParallelTests::RSpec::RuntimeLogger

Public Class Methods

new(*args) click to toggle source
Calls superclass method ParallelTests::RSpec::LoggerBase::new
# File lib/parallel_tests/rspec/runtime_logger.rb, line 5
def initialize(*args)
  super
  @example_times = Hash.new(0)
  @group_nesting = 0
end

Public Instance Methods

dump_failure(*args) click to toggle source
# File lib/parallel_tests/rspec/runtime_logger.rb, line 32
def dump_failure(*args);end
dump_failures(*args) click to toggle source
# File lib/parallel_tests/rspec/runtime_logger.rb, line 31
def dump_failures(*args);end
dump_pending(*args) click to toggle source
# File lib/parallel_tests/rspec/runtime_logger.rb, line 33
def dump_pending(*args);end
dump_summary(*args) click to toggle source
# File lib/parallel_tests/rspec/runtime_logger.rb, line 30
def dump_summary(*args);end
example_group_finished(notification) click to toggle source
Calls superclass method
# File lib/parallel_tests/rspec/runtime_logger.rb, line 21
def example_group_finished(notification)
  @group_nesting -= 1
  if @group_nesting == 0
    path = (RSPEC_2 ? notification.file_path : notification.group.file_path)
    @example_times[path] += ParallelTests.now - @time
  end
  super if defined?(super)
end
example_group_started(example_group) click to toggle source
Calls superclass method
# File lib/parallel_tests/rspec/runtime_logger.rb, line 15
def example_group_started(example_group)
  @time = ParallelTests.now if @group_nesting == 0
  @group_nesting += 1
  super
end
start_dump(*args) click to toggle source
# File lib/parallel_tests/rspec/runtime_logger.rb, line 35
def start_dump(*args)
  return unless ENV['TEST_ENV_NUMBER'] #only record when running in parallel
  lock_output do
    @example_times.each do |file, time|
      relative_path = file.sub(/^#{Regexp.escape Dir.pwd}\//,'').sub(/^\.\//, "")
      @output.puts "#{relative_path}:#{time > 0 ? time : 0}"
    end
  end
  @output.flush
end