Commit 4d8f588e authored by Toon Claes's avatar Toon Claes

test: Raise exception when Gitaly build fails

Kernel#system by default returns false when the command fails. Before
this change the return value was not looked at. With this change we pass
`exception: true` to system() so it raises an exception on failure.
parent d91184c2
......@@ -100,12 +100,16 @@ module GitalySetup
end
end
def run_command(cmd, env: {})
system(env, *cmd, exception: true, chdir: tmp_tests_gitaly_dir)
end
def install_gitaly_gems
system(env, "make #{tmp_tests_gitaly_dir}/.ruby-bundle", chdir: tmp_tests_gitaly_dir) # rubocop:disable GitlabSecurity/SystemCommandInjection
run_command(%W[make #{tmp_tests_gitaly_dir}/.ruby-bundle], env: env)
end
def build_gitaly
system(env.merge({ 'GIT_VERSION' => nil }), 'make all git', chdir: tmp_tests_gitaly_dir) # rubocop:disable GitlabSecurity/SystemCommandInjection
run_command(%w[make all git], env: env.merge('GIT_VERSION' => nil))
end
def start_gitaly
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment