From 3e664853001e201eb02c79645f4a84cfc6a48ad9 Mon Sep 17 00:00:00 2001 From: Luke Hill <20105237+luke-hill@users.noreply.github.com> Date: Sat, 14 Aug 2021 00:39:16 +0100 Subject: [PATCH] Permit parallel_tests/cucumber running to allow --retry flag (#827) * 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 --- CHANGELOG.md | 3 ++- lib/parallel_tests/gherkin/runner.rb | 4 ++-- spec/fixtures/rails60/Gemfile.lock | 4 ++-- spec/fixtures/rails61/Gemfile.lock | 4 ++-- spec/parallel_tests/gherkin/runner_behaviour.rb | 12 ++++++------ 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9571c1a7..ce24b5c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/parallel_tests/gherkin/runner.rb b/lib/parallel_tests/gherkin/runner.rb index 0253fd9e..5e2b7bb0 100644 --- a/lib/parallel_tests/gherkin/runner.rb +++ b/lib/parallel_tests/gherkin/runner.rb @@ -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 diff --git a/spec/fixtures/rails60/Gemfile.lock b/spec/fixtures/rails60/Gemfile.lock index e27df67c..56b81163 100644 --- a/spec/fixtures/rails60/Gemfile.lock +++ b/spec/fixtures/rails60/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../../.. specs: - parallel_tests (3.5.2) + parallel_tests (3.7.0) parallel GEM @@ -121,4 +121,4 @@ DEPENDENCIES tzinfo-data BUNDLED WITH - 2.2.15 + 2.2.19 diff --git a/spec/fixtures/rails61/Gemfile.lock b/spec/fixtures/rails61/Gemfile.lock index f261b956..53ae4530 100644 --- a/spec/fixtures/rails61/Gemfile.lock +++ b/spec/fixtures/rails61/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../../.. specs: - parallel_tests (3.5.2) + parallel_tests (3.7.0) parallel GEM @@ -122,4 +122,4 @@ DEPENDENCIES tzinfo-data BUNDLED WITH - 2.2.15 + 2.2.19 diff --git a/spec/parallel_tests/gherkin/runner_behaviour.rb b/spec/parallel_tests/gherkin/runner_behaviour.rb index f8b6eaad..f6451bb0 100644 --- a/spec/parallel_tests/gherkin/runner_behaviour.rb +++ b/spec/parallel_tests/gherkin/runner_behaviour.rb @@ -74,9 +74,9 @@ 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') @@ -84,9 +84,9 @@ def call(*args) 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') @@ -94,9 +94,9 @@ def call(*args) 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')