bin/parallel_test in parallel_tests-0.4.16 vs bin/parallel_test in parallel_tests-0.4.17

- old
+ new

@@ -22,11 +22,12 @@ opts.on("-m [FLOAT]", "--multiply-processes [FLOAT]", Float, "use given number as a multiplier of processes to run"){ |multiply| options[:multiply] = multiply } opts.on("-r", '--root [PATH]', "execute test commands from this path"){|path| options[:root] = path } opts.on("-e", '--exec [COMMAND]', "execute this code parallel and with ENV['TEST_ENV_NUM']"){|path| options[:execute] = path } opts.on("-o", "--test-options '[OPTIONS]'", "execute test commands with those options"){|arg| options[:test_options] = arg } opts.on("-t", "--type [TYPE]", "which type of tests to run? test, spec or features"){|type| options[:type] = type } - opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec"){|type| options[:non_parallel] = true } + opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec"){ options[:non_parallel] = true } + opts.on("--chunk-timeout [TIMEOUT]", "timeout before re-printing the output of a child-process"){|timeout| options[:chunk_timeout] = timeout.to_f } opts.on('-v', '--version', 'Show Version'){ puts ParallelTests::VERSION; exit} opts.on("-h", "--help", "Show this.") { puts opts; exit } end.parse! # get files to run from arguments @@ -37,15 +38,15 @@ if options[:execute] runs = (0...num_processes).to_a results = if options[:non_parallel] runs.map do |i| - ParallelTests.execute_command(options[:execute], i) + ParallelTests.execute_command(options[:execute], i, options) end else Parallel.map(runs, :in_processes => num_processes) do |i| - ParallelTests.execute_command(options[:execute], i) + ParallelTests.execute_command(options[:execute], i, options) end end.flatten abort if results.any?{|r| r[:exit_status] != 0 } else lib, name, task = { @@ -70,11 +71,11 @@ num_tests = groups.inject(0){|sum,item| sum + item.size } puts "#{num_processes} processes for #{num_tests} #{name}s, ~ #{num_tests / groups.size} #{name}s per process" test_results = Parallel.map(groups, :in_processes => num_processes) do |group| - klass.run_tests(group, groups.index(group), options[:test_options]) + klass.run_tests(group, groups.index(group), options) end #parse and print results results = klass.find_results(test_results.map{|result| result[:stdout] }*"") puts "" @@ -86,6 +87,6 @@ puts "Took #{Time.now - start} seconds" #exit with correct status code so rake parallel:test && echo 123 works failed = test_results.any?{|result| result[:exit_status] != 0 } abort "#{name.capitalize}s Failed" if failed -end \ No newline at end of file +end