lib/parallel_tests/gherkin/runner.rb in parallel_tests-0.16.3 vs lib/parallel_tests/gherkin/runner.rb in parallel_tests-0.16.4

- old
+ new

@@ -17,11 +17,11 @@ ].compact.join(" ") execute_command(cmd, process_number, num_processes, options) end def test_file_name - "feature" + @test_file_name || "feature" end def test_suffix /\.feature$/ end @@ -35,11 +35,11 @@ # 1 step (1 failed) def summarize_results(results) sort_order = %w[scenario step failed undefined skipped pending passed] %w[scenario step].map do |group| - group_results = results.grep /^\d+ #{group}/ + group_results = results.grep(/^\d+ #{group}/) next if group_results.empty? sums = sum_up_results(group_results) sums = sums.sort_by { |word, _| sort_order.index(word) || 999 } sums.map! do |word, number| @@ -65,12 +65,16 @@ "--profile parallel" end end def tests_in_groups(tests, num_groups, options={}) - if options[:group_by] == :steps - Grouper.by_steps(find_tests(tests, options), num_groups, options) + if options[:group_by] == :scenarios + @test_file_name = "scenario" + end + method = "by_#{options[:group_by]}" + if Grouper.respond_to?(method) + Grouper.send(method, find_tests(tests, options), num_groups, options) else super end end @@ -83,17 +87,17 @@ "tmp/parallel_runtime_#{name}.log" end def determine_executable case - when File.exists?("bin/#{name}") - "bin/#{name}" - when ParallelTests.bundler_enabled? - "bundle exec #{name}" - when File.file?("script/#{name}") - "script/#{name}" - else - "#{name}" + when File.exists?("bin/#{name}") + "bin/#{name}" + when ParallelTests.bundler_enabled? + "bundle exec #{name}" + when File.file?("script/#{name}") + "script/#{name}" + else + "#{name}" end end end end