diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 21:08:01 +0000 |
commit | 95ad46159e4cd93f2b31838199180d824e041994 (patch) | |
tree | d41880d3b6a0093463694978590e590efb08caef /spec/lib/gitlab | |
parent | 2c72daf2f1744f2b8c8c6674c266907e9ef55558 (diff) | |
download | gitlab-ce-95ad46159e4cd93f2b31838199180d824e041994.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 9 | ||||
-rw-r--r-- | spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb | 20 |
2 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index b706cad612a..183e6e8d044 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1919,6 +1919,15 @@ describe Gitlab::Git::Repository, :seed_helper do end end + describe '#replicas', :praefect do + it 'gets the replica checksum through praefect' do + resp = repository.replicas + + expect(resp.replicas).to be_empty + expect(resp.primary.checksum).to eq(repository.checksum) + end + end + describe '#clean_stale_repository_files' do let(:worktree_id) { 'rebase-1' } let(:gitlab_worktree_path) { File.join(repository_path, 'gitlab-worktree', worktree_id) } diff --git a/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb b/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb new file mode 100644 index 00000000000..9b5c751e0ec --- /dev/null +++ b/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Gitlab::GitalyClient::PraefectInfoService do + let(:project) { create(:project, :repository) } + let(:repository) { project.repository } + let(:gitaly_repository) { repository.gitaly_repository } + let(:client) { described_class.new(repository) } + + describe '#repository_replicas', :praefect do + it 'sends an RPC request' do + request = Gitaly::RepositoryReplicasRequest.new(repository: gitaly_repository) + + expect_any_instance_of(Gitaly::PraefectInfoService::Stub).to receive(:repository_replicas).with(request, kind_of(Hash)) + + client.replicas + end + end +end |