Skip to content
Snippets Groups Projects
Commit de765888 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Output the stdout of the sub-tasks when running promote-to-primary

parent a11fe033
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -76,18 +76,19 @@ module Geo
puts 'Reconfiguring...'.color(:yellow)
puts
 
run_command('gitlab-ctl reconfigure')
run_command('gitlab-ctl reconfigure', live: true)
end
 
def promote_to_primary
puts
puts 'Running gitlab-rake geo:set_secondary_as_primary...'.color(:yellow)
puts
run_command('gitlab-rake geo:set_secondary_as_primary')
run_command('gitlab-rake geo:set_secondary_as_primary', live: true)
end
 
def run_command(cmd)
GitlabCtl::Util.run_command(cmd)
def run_command(cmd, live: false)
GitlabCtl::Util.run_command(cmd, live: live)
end
 
def key_path
Loading
Loading
Loading
Loading
@@ -28,7 +28,9 @@ describe Geo::PromoteToPrimary, '#execute' do
it 'calls all the subcommands' do
stub_env
 
is_expected.to receive(:run_command).exactly(3).times
is_expected.to receive(:run_command).with('gitlab-ctl reconfigure', live: true).once
is_expected.to receive(:run_command).with('gitlab-rake geo:set_secondary_as_primary', live: true).once
is_expected.to receive(:run_command).with("touch #{postgres_trigger_file_path}").once
 
command.execute
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment