From b73f72b924643f7a356a537a7da1e2506c623f65 Mon Sep 17 00:00:00 2001 From: Eric Lindvall Date: Thu, 7 Jan 2016 18:04:34 -0800 Subject: [PATCH] Don't treat run() as a parallel task Fixes a regression from #457 --- .../configuration/actions/invocation.rb | 2 +- test/configuration/actions/invocation_test.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/capistrano/configuration/actions/invocation.rb b/lib/capistrano/configuration/actions/invocation.rb index f43e7ebf..3257a893 100644 --- a/lib/capistrano/configuration/actions/invocation.rb +++ b/lib/capistrano/configuration/actions/invocation.rb @@ -320,7 +320,7 @@ module Capistrano branches += server_branches end branches - end + end.compact.uniq end end diff --git a/test/configuration/actions/invocation_test.rb b/test/configuration/actions/invocation_test.rb index b019f754..7be35b46 100644 --- a/test/configuration/actions/invocation_test.rb +++ b/test/configuration/actions/invocation_test.rb @@ -243,6 +243,12 @@ class ConfigurationActionsInvocationTest < Test::Unit::TestCase def test_parallel_command_execution_with_matching_servers @config.expects(:execute_on_servers) + + logger = mock('logger') + logger.stubs(:debug).with("executing multiple commands in parallel").once + logger.stubs(:trace).twice + @config.stubs(:logger).returns(logger) + assert_block("should not raise Argument error") do begin @config.servers = [:app, :db] @@ -258,6 +264,18 @@ class ConfigurationActionsInvocationTest < Test::Unit::TestCase end end + def test_run_only_logs_once + @config.servers = [:app, :db] + + logger = mock('logger') + logger.stubs(:debug).with("executing \"ls\"") + @config.stubs(:logger).returns(logger) + + @config.expects(:execute_on_servers) + + @config.run("ls") + end + private def make_config