Class: ParallelTests::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel_tests/cli.rb

Instance Method Summary collapse

Instance Method Details

#run(argv) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/parallel_tests/cli.rb', line 10

def run(argv)
  Signal.trap("INT") { handle_interrupt }

  options = parse_options!(argv)

  ENV['DISABLE_SPRING'] ||= '1'

  num_processes = ParallelTests.determine_number_of_processes(options[:count])
  num_processes *= (options[:multiply] || 1)

  options[:first_is_1] ||= first_is_1?

  if options[:execute]
    execute_command_in_parallel(options[:execute], num_processes, options)
  else
    run_tests_in_parallel(num_processes, options)
  end
end