diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-05 17:43:37 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-05 17:43:37 +0300 |
commit | 422fa21d0a7a4f7dd36ccb42e484c721398558b0 (patch) | |
tree | 24a3f935cb9aa3ee082b6f5c42e852055f60b250 /spec | |
parent | b8a62abd53d6e58c14212933fe96b0ebb9d0be4f (diff) | |
parent | 40fd0b9e405ec8e4c37e8c90d44dde6c98e1176c (diff) |
Merge branch '11126-fix-repository-size-check-ce' into 'master'
Add client code to call GetObjectDirectorySize RPC
See merge request gitlab-org/gitlab-ce!28918
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/gitlab/gitaly_client/repository_service_spec.rb | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index cb4701e8edc..e72fb9c6fbc 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -186,6 +186,18 @@ describe Gitlab::Git::Repository, :seed_helper do it { is_expected.to be < 2 } end + describe '#object_directory_size' do + before do + allow(repository.gitaly_repository_client) + .to receive(:get_object_directory_size) + .and_return(2) + end + + subject { repository.object_directory_size } + + it { is_expected.to eq 2048 } + end + describe '#empty?' do it { expect(repository).not_to be_empty } end diff --git a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb index 09de7ca6afd..a3808adb376 100644 --- a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb @@ -73,6 +73,17 @@ describe Gitlab::GitalyClient::RepositoryService do end end + describe '#get_object_directory_size' do + it 'sends a get_object_directory_size message' do + expect_any_instance_of(Gitaly::RepositoryService::Stub) + .to receive(:get_object_directory_size) + .with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash)) + .and_return(size: 0) + + client.get_object_directory_size + end + end + describe '#apply_gitattributes' do let(:revision) { 'master' } |