diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-08 22:24:03 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-08 22:24:03 +0000 |
commit | bd50ecbad8c00e7c9ab5c60fa8bc839a8905b4ab (patch) | |
tree | ef6f70f6c4563ee0fd227d245d5db84f0bd0b110 /spec | |
parent | cd16600eef48e697d737d92bdebf003b66af1426 (diff) | |
parent | 15ddfa2b5bd9f570cea4ddd2cf4a6db90c40b146 (diff) | |
download | gitlab-ce-bd50ecbad8c00e7c9ab5c60fa8bc839a8905b4ab.tar.gz |
Merge branch '41683-timeout-is-not-set-for-gitaly-fetch_remote-calls' into 'master'
Resolve "Timeout is not set for gitaly fetch_remote calls"
Closes #41683
See merge request gitlab-org/gitlab-ce!16245
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/shell_spec.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/lib/gitlab/shell_spec.rb b/spec/lib/gitlab/shell_spec.rb index 81d9e6a8f82..ffd2d2c7afc 100644 --- a/spec/lib/gitlab/shell_spec.rb +++ b/spec/lib/gitlab/shell_spec.rb @@ -4,6 +4,7 @@ require 'stringio' describe Gitlab::Shell do set(:project) { create(:project, :repository) } + let(:repository) { project.repository } let(:gitlab_shell) { described_class.new } let(:popen_vars) { { 'GIT_TERMINAL_PROMPT' => ENV['GIT_TERMINAL_PROMPT'] } } let(:gitlab_projects) { double('gitlab_projects') } @@ -201,8 +202,6 @@ describe Gitlab::Shell do end shared_examples 'fetch_remote' do |gitaly_on| - let(:repository) { project.repository } - def fetch_remote(ssh_auth = nil) gitlab_shell.fetch_remote(repository.raw_repository, 'remote-name', ssh_auth: ssh_auth) end @@ -325,6 +324,23 @@ describe Gitlab::Shell do describe '#fetch_remote gitaly' do it_should_behave_like 'fetch_remote', true + + context 'gitaly call' do + let(:remote_name) { 'remote-name' } + let(:ssh_auth) { double(:ssh_auth) } + + subject do + gitlab_shell.fetch_remote(repository.raw_repository, remote_name, + forced: true, no_tags: true, ssh_auth: ssh_auth) + end + + it 'passes the correct params to the gitaly service' do + expect(repository.gitaly_repository_client).to receive(:fetch_remote) + .with(remote_name, ssh_auth: ssh_auth, forced: true, no_tags: true, timeout: timeout) + + subject + end + end end describe '#import_repository' do |