Commit 07c517de authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'revert-b0863dc8' into 'master'

Restore Gitaly server update and fix cached Git binary

See merge request gitlab-org/gitlab!72839
parents ddf17782 ffc34438
......@@ -44,6 +44,7 @@
prefix: "gitaly-binaries"
paths:
- tmp/tests/gitaly/_build/bin/
- tmp/tests/gitaly/_build/deps/git/install/
- tmp/tests/gitaly/config.toml
- tmp/tests/gitaly/gitaly2.config.toml
- tmp/tests/gitaly/internal/
......
......@@ -181,6 +181,7 @@ setup-test-env:
paths:
- config/secrets.yml
- tmp/tests/gitaly/_build/bin/
- tmp/tests/gitaly/_build/deps/git/install
- tmp/tests/gitaly/config.toml
- tmp/tests/gitaly/gitaly2.config.toml
- tmp/tests/gitaly/internal/
......
4f0a07ba39f14adacf7d482128a5de2bb84f0eac
ee4b20cc318876c4b237e277fefd9d75186a085c
......@@ -104,9 +104,6 @@ module Gitlab
socket_filename = options[:gitaly_socket] || "gitaly.socket"
prometheus_listen_addr = options[:prometheus_listen_addr]
git_bin_path = File.expand_path('../gitaly/_build/deps/git/install/bin/git')
git_bin_path = nil unless File.exist?(git_bin_path)
config = {
# Override the set gitaly_address since Praefect is in the loop
socket_path: File.join(gitaly_dir, socket_filename),
......@@ -116,8 +113,8 @@ module Gitlab
# sidekiq jobs, and concurrency will be low anyway in test.
git: {
catfile_cache_size: 5,
bin_path: git_bin_path
}.compact,
bin_path: File.expand_path(File.join(gitaly_dir, '_build', 'deps', 'git', 'install', 'bin', 'git'))
},
prometheus_listen_addr: prometheus_listen_addr
}.compact
......
......@@ -67,7 +67,7 @@ Usage: rake "gitlab:gitaly:install[/installation/dir,/storage/path]")
env["BUNDLE_DEPLOYMENT"] = 'false'
end
Gitlab::Popen.popen([make_cmd], nil, env)
Gitlab::Popen.popen([make_cmd, 'all', 'git'], nil, env)
end
end
end
......
......@@ -208,10 +208,10 @@ RSpec.describe BranchesFinder do
context 'by page_token only' do
let(:params) { { page_token: 'feature' } }
it 'returns nothing' do
result = subject
expect(result.count).to eq(0)
it 'raises an error' do
expect do
subject
end.to raise_error(Gitlab::Git::CommandError, '13:could not find page token.')
end
end
......
......@@ -98,7 +98,7 @@ module GitalySetup
end
def build_gitaly
system(env, 'make', chdir: tmp_tests_gitaly_dir) # rubocop:disable GitlabSecurity/SystemCommandInjection
system(env.merge({ 'GIT_VERSION' => nil }), 'make all git', chdir: tmp_tests_gitaly_dir) # rubocop:disable GitlabSecurity/SystemCommandInjection
end
def start_gitaly
......
......@@ -68,7 +68,7 @@ RSpec.describe 'gitlab:gitaly namespace rake task', :silence_stdout do
it 'calls gmake in the gitaly directory' do
expect(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['/usr/bin/gmake', 0])
expect(Gitlab::Popen).to receive(:popen).with(%w[gmake], nil, { "BUNDLE_GEMFILE" => nil, "RUBYOPT" => nil }).and_return(true)
expect(Gitlab::Popen).to receive(:popen).with(%w[gmake all git], nil, { "BUNDLE_GEMFILE" => nil, "RUBYOPT" => nil }).and_return(true)
subject
end
......@@ -81,13 +81,13 @@ RSpec.describe 'gitlab:gitaly namespace rake task', :silence_stdout do
end
it 'calls make in the gitaly directory' do
expect(Gitlab::Popen).to receive(:popen).with(%w[make], nil, { "BUNDLE_GEMFILE" => nil, "RUBYOPT" => nil }).and_return(true)
expect(Gitlab::Popen).to receive(:popen).with(%w[make all git], nil, { "BUNDLE_GEMFILE" => nil, "RUBYOPT" => nil }).and_return(true)
subject
end
context 'when Rails.env is test' do
let(:command) { %w[make] }
let(:command) { %w[make all git] }
before do
stub_rails_env('test')
......
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