summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/shell_spec.rb
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2018-01-04 23:34:31 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2018-01-05 18:27:00 -0300
commit15ddfa2b5bd9f570cea4ddd2cf4a6db90c40b146 (patch)
treef4ee6b6076296af12e51047f70fb5092a035f45d /spec/lib/gitlab/shell_spec.rb
parent3d162d192ba2a57776de62b553a2a0a9a9245f8a (diff)
downloadgitlab-ce-15ddfa2b5bd9f570cea4ddd2cf4a6db90c40b146.tar.gz
Pass timeout to RepositoryService.FetchRemote Gitaly RPC calls41683-timeout-is-not-set-for-gitaly-fetch_remote-calls
Diffstat (limited to 'spec/lib/gitlab/shell_spec.rb')
-rw-r--r--spec/lib/gitlab/shell_spec.rb20
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