Skip to content

Commit

Permalink
Allow passing custom command lines as "PARALLEL_TESTS_EXECUTABLE" (#972)
Browse files Browse the repository at this point in the history
* Restore support for passing custom command lines as PARALLEL_TESTS_EXECUTABLE.

* Fix RuboCop failures introduced recently
  • Loading branch information
deivid-rodriguez committed Sep 10, 2024
1 parent 7584bfd commit e96f60c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Fixed

- Restore support for passing custom command lines as PARALLEL_TESTS_EXECUTABLE.

## 4.7.1 - 2024-04-25

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/parallel_tests/test/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def command_with_seed(cmd, seed)

def executable
if (executable = ENV['PARALLEL_TESTS_EXECUTABLE'])
[executable]
Shellwords.shellsplit(executable)
else
determine_executable
end
Expand Down
2 changes: 0 additions & 2 deletions parallel_tests.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Gem::Specification.new name, ParallelTests::VERSION do |s|
"wiki_uri" => "https://github.com/grosser/#{name}/wiki"
}



s.files = Dir["{lib,bin}/**/*"] + ["Readme.md"]
s.license = "MIT"
s.executables = ["parallel_spinach", "parallel_cucumber", "parallel_rspec", "parallel_test"]
Expand Down
6 changes: 6 additions & 0 deletions spec/parallel_tests/test/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def call(*args)
expect(a).to include("script/custom_rspec")
end
call(['xxx'], 1, 22, {})

ENV['PARALLEL_TESTS_EXECUTABLE'] = 'ruby -Icustom_option script/custom_rspec'
expect(ParallelTests::Test::Runner).to receive(:execute_command) do |a, _, _, _d|
expect(a).to include("ruby", "-Icustom_option", "script/custom_rspec")
end
call(['xxx'], 1, 22, {})
end

it "uses options" do
Expand Down

0 comments on commit e96f60c

Please sign in to comment.