Skip to content

Commit

Permalink
Permit parallel_tests/cucumber running to allow --retry flag (#827)
Browse files Browse the repository at this point in the history
* Initial copy of debug logic

* It seems as though pushing all cucumber options to the end of the command invocation also works!

* Update rails bundles for fixtures

* Attempt to fix specs
  • Loading branch information
luke-hill committed Aug 13, 2021
1 parent 13948ee commit 3e66485
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -12,7 +12,8 @@

### Fixed

- None
- All cucumber options are now pushed to the end of the command invocation
- Fixes an issue where the `--retry` flag wouldn't work correctly

## v3.7.0 - 2021-04-08

Expand Down
4 changes: 2 additions & 2 deletions lib/parallel_tests/gherkin/runner.rb
Expand Up @@ -24,8 +24,8 @@ def run_tests(test_files, process_number, num_processes, options)
cmd = [
executable,
(runtime_logging if File.directory?(File.dirname(runtime_log))),
cucumber_opts(options[:test_options]),
*sanitized_test_files
*sanitized_test_files,
cucumber_opts(options[:test_options])
].compact.reject(&:empty?).join(' ')
execute_command(cmd, process_number, num_processes, options)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/rails60/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: ../../..
specs:
parallel_tests (3.5.2)
parallel_tests (3.7.0)
parallel

GEM
Expand Down Expand Up @@ -121,4 +121,4 @@ DEPENDENCIES
tzinfo-data

BUNDLED WITH
2.2.15
2.2.19
4 changes: 2 additions & 2 deletions spec/fixtures/rails61/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: ../../..
specs:
parallel_tests (3.5.2)
parallel_tests (3.7.0)
parallel

GEM
Expand Down Expand Up @@ -122,4 +122,4 @@ DEPENDENCIES
tzinfo-data

BUNDLED WITH
2.2.15
2.2.19
12 changes: 6 additions & 6 deletions spec/parallel_tests/gherkin/runner_behaviour.rb
Expand Up @@ -74,29 +74,29 @@ def call(*args)

it "uses parallel profile" do
if ParallelTests::WINDOWS
should_run_with %r{script/#{runner_name} .*foo bar --profile parallel "xxx"}
should_run_with %r{script/#{runner_name} "xxx" .*foo bar --profile parallel}
else
should_run_with %r{script/#{runner_name} .*foo bar --profile parallel xxx}
should_run_with %r{script/#{runner_name} xxx .*foo bar --profile parallel}
end

call(['xxx'], 1, 22, test_options: 'foo bar')
end

it "uses given profile via --profile" do
if ParallelTests::WINDOWS
should_run_with %r{script/#{runner_name} .*--profile foo "xxx"$}
should_run_with %r{script/#{runner_name} "xxx" .*--profile foo$}
else
should_run_with %r{script/#{runner_name} .*--profile foo xxx$}
should_run_with %r{script/#{runner_name} xxx .*--profile foo$}
end

call(['xxx'], 1, 22, test_options: '--profile foo')
end

it "uses given profile via -p" do
if ParallelTests::WINDOWS
should_run_with %r{script/#{runner_name} .*-p foo "xxx"$}
should_run_with %r{script/#{runner_name} "xxx" .*-p foo$}
else
should_run_with %r{script/#{runner_name} .*-p foo xxx$}
should_run_with %r{script/#{runner_name} xxx .*-p foo$}
end

call(['xxx'], 1, 22, test_options: '-p foo')
Expand Down

0 comments on commit 3e66485

Please sign in to comment.