lib/parallel_tests/tasks.rb in parallel_tests-2.16.0 vs lib/parallel_tests/tasks.rb in parallel_tests-2.16.1
- old
+ new
@@ -13,13 +13,13 @@
end
end
def run_in_parallel(cmd, options={})
count = " -n #{options[:count]}" unless options[:count].to_s.empty?
+ # Using the relative path to find the binary allow to run a specific version of it
executable = File.expand_path("../../../bin/parallel_test", __FILE__)
- command = "#{Shellwords.escape executable} --exec '#{cmd}'#{count}#{' --non-parallel' if options[:non_parallel]}"
- command = ParallelTests.with_ruby_binary(command)
+ command = "#{ParallelTests.with_ruby_binary(Shellwords.escape(executable))} --exec '#{cmd}'#{count}#{' --non-parallel' if options[:non_parallel]}"
abort unless system(command)
end
# this is a crazy-complex solution for a very simple problem:
# removing certain lines from the output without changing the exit-status
@@ -156,16 +156,16 @@
}[type]
if test_framework == 'spinach'
type = 'features'
end
+ # Using the relative path to find the binary allow to run a specific version of it
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallel_test')
- command = "#{Shellwords.escape executable} #{type} --type #{test_framework} " \
+ command = "#{ParallelTests.with_ruby_binary(Shellwords.escape(executable))} #{type} --type #{test_framework} " \
"-n #{count} " \
"--pattern '#{pattern}' " \
"--test-options '#{options}'"
- command = ParallelTests.with_ruby_binary(command)
abort unless system(command) # allow to chain tasks e.g. rake parallel:spec parallel:features
end
end
end