Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing custom command lines as "PARALLEL_TESTS_EXECUTABLE" #972

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading