diff options
author | John Cai <jcai@gitlab.com> | 2019-04-24 18:50:45 -0700 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-04-30 08:28:56 -0700 |
commit | 5ee7876534891df9c2f5ab6c5112cc47f98b1df5 (patch) | |
tree | cf9a3cf85b7404b7a815987b66951726a4618947 /spec/lib/gitlab/gitaly_client | |
parent | fbaafdd767bc83b47ac4094a2865c8e84fae882c (diff) | |
download | gitlab-ce-5ee7876534891df9c2f5ab6c5112cc47f98b1df5.tar.gz |
Add client methods for FetchIntoObjectPool RPC
Gitaly's FetchIntoObjectPool RPC will idempotently fetch objects into an
object pool. If the pool doesn't exist, it will create an empty pool
before attempting the fetch. This change adds client code as well as
specs to cover this behavior.
Diffstat (limited to 'spec/lib/gitlab/gitaly_client')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb b/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb index 149b7ec5bb0..0e0c3d329b5 100644 --- a/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb @@ -43,4 +43,24 @@ describe Gitlab::GitalyClient::ObjectPoolService do end end end + + describe '#fetch' do + before do + subject.delete + end + + it 'restores the pool repository objects' do + subject.fetch(project.repository) + + expect(object_pool.repository.exists?).to be(true) + end + + context 'when called twice' do + it "doesn't raise an error" do + subject.delete + + expect { subject.fetch(project.repository) }.not_to raise_error + end + end + end end |