Skip to content

Commit

Permalink
Remove :verbose_command option
Browse files Browse the repository at this point in the history
It's now just an alias to --verbose-process-command and
--verbose-rerun-command combined.
  • Loading branch information
priceline-rosenfeld committed Apr 25, 2024
1 parent c13ff93 commit cb00da7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/parallel_tests/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def report_failure_rerun_commmand(test_results, options)
failing_sets = test_results.reject { |r| r[:exit_status] == 0 }
return if failing_sets.none?

if options[:verbose] || options[:verbose_command] || options[:verbose_rerun_command]
if options[:verbose] || options[:verbose_rerun_command]
puts "\n\nTests have failed for a parallel_test group. Use the following command to run the group again:\n\n"
failing_sets.each do |failing_set|
command = failing_set[:command]
Expand Down Expand Up @@ -291,7 +291,7 @@ def parse_options!(argv)
opts.on("--first-is-1", "Use \"1\" as TEST_ENV_NUMBER to not reuse the default test environment") { options[:first_is_1] = true }
opts.on("--fail-fast", "Stop all groups when one group fails (best used with --test-options '--fail-fast' if supported") { options[:fail_fast] = true }
opts.on("--verbose", "Print debug output") { options[:verbose] = true }
opts.on("--verbose-command", "Combines options --verbose-process-command and --verbose-rerun-command") { options[:verbose_command] = true }
opts.on("--verbose-command", "Combines options --verbose-process-command and --verbose-rerun-command") { options.merge! verbose_process_command: true, verbose_rerun_command: true }
opts.on("--verbose-process-command", "Print the command that will be executed by each process before it begins") { options[:verbose_process_command] = true }
opts.on("--verbose-rerun-command", "After a process fails, print the command executed by that process") { options[:verbose_rerun_command] = true }
opts.on("--quiet", "Print only tests output") { options[:quiet] = true }
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 @@ -293,7 +293,7 @@ def set_unknown_runtime(tests, options)
end

def report_process_command?(options)
options[:verbose] || options[:verbose_command] || options[:verbose_process_command]
options[:verbose] || options[:verbose_process_command]
end
end
end
Expand Down
10 changes: 1 addition & 9 deletions spec/parallel_tests/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def call(*args)

it "parses --verbose-command" do
expect(call(['test', '--verbose-command'])).to eq(
defaults.merge(verbose_command: true)
defaults.merge(verbose_process_command: true, verbose_rerun_command: true)
)
end

Expand Down Expand Up @@ -251,14 +251,6 @@ def self.it_prints_nothing_about_rerun_commands(options)
it_prints_nothing_about_rerun_commands(verbose: false)
end

context "with verbose command" do
it "prints command if there is a failure" do
expect do
subject.send(:report_failure_rerun_commmand, single_failed_command, verbose_command: true)
end.to output("\n\nTests have failed for a parallel_test group. Use the following command to run the group again:\n\nTEST_ENV_NUMBER= PARALLEL_TEST_GROUPS= foo\n").to_stdout
end
end

context "with verbose rerun command" do
it "prints command if there is a failure" do
expect do
Expand Down

0 comments on commit cb00da7

Please sign in to comment.