lib/parallel_tests/cli.rb in parallel_tests-1.0.5 vs lib/parallel_tests/cli.rb in parallel_tests-1.0.6
- old
+ new
@@ -34,13 +34,15 @@
report_time_taken do
groups = @runner.tests_in_groups(options[:files], num_processes, options)
test_results = if options[:only_group]
- group_to_run = groups[options[:only_group] - 1]
-
- [run_tests(group_to_run, 0, num_processes, options)]
+ groups_to_run = options[:only_group].collect{|i| groups[i - 1]}
+ report_number_of_tests(groups_to_run)
+ execute_in_parallel(groups_to_run, groups_to_run.size, options) do |group|
+ run_tests(group, groups_to_run.index(group), 1, options)
+ end
else
report_number_of_tests(groups)
execute_in_parallel(groups, groups.size, options) do |group|
run_tests(group, groups.index(group), num_processes, options)
@@ -122,10 +124,10 @@
"Do not run any other tests in the group used by --single(-s)") do |pattern|
options[:isolate] = true
end
- opts.on("--only-group [INTEGER]", Integer) { |group| options[:only_group] = group }
+ opts.on("--only-group INT[, INT]", Array) { |groups| options[:only_group] = groups.map(&:to_i) }
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]", "test(default) / rspec / cucumber / spinach") do |type|
begin