diff options
author | Sean McGivern <sean@gitlab.com> | 2018-11-20 10:36:52 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-11-20 10:36:52 +0000 |
commit | 2742b871fe44c649b4b503d10f5875276fb8fd87 (patch) | |
tree | 4c022342bd0b7f2f9464b2fe6ee5a8d1e8a58a34 /spec/lib/gitlab/git/tag_spec.rb | |
parent | 799486373e74711db65c2f77d11b1ec77fd7f4d9 (diff) | |
download | gitlab-ce-2742b871fe44c649b4b503d10f5875276fb8fd87.tar.gz |
Revert "Merge branch 'zj-improve-gitaly-pb' into 'master'"revert-e2aa2177
This reverts merge request !23140
Diffstat (limited to 'spec/lib/gitlab/git/tag_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/tag_spec.rb | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/spec/lib/gitlab/git/tag_spec.rb b/spec/lib/gitlab/git/tag_spec.rb index abee2822d77..c5bad062c2a 100644 --- a/spec/lib/gitlab/git/tag_spec.rb +++ b/spec/lib/gitlab/git/tag_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" describe Gitlab::Git::Tag, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '') } - describe '#tags' do + shared_examples 'Gitlab::Git::Repository#tags' do describe 'first tag' do let(:tag) { repository.tags.first } @@ -25,6 +25,14 @@ describe Gitlab::Git::Tag, :seed_helper do it { expect(repository.tags.size).to eq(SeedRepo::Repo::TAGS.size) } end + context 'when Gitaly tags feature is enabled' do + it_behaves_like 'Gitlab::Git::Repository#tags' + end + + context 'when Gitaly tags feature is disabled', :skip_gitaly_mock do + it_behaves_like 'Gitlab::Git::Repository#tags' + end + describe '.get_message' do let(:tag_ids) { %w[f4e6814c3e4e7a0de82a9e7cd20c626cc963a2f8 8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b] } @@ -32,13 +40,23 @@ describe Gitlab::Git::Tag, :seed_helper do tag_ids.map { |id| described_class.get_message(repository, id) } end - it 'gets tag messages' do - expect(subject[0]).to eq("Release\n") - expect(subject[1]).to eq("Version 1.1.0\n") + shared_examples 'getting tag messages' do + it 'gets tag messages' do + expect(subject[0]).to eq("Release\n") + expect(subject[1]).to eq("Version 1.1.0\n") + end + end + + context 'when Gitaly tag_messages feature is enabled' do + it_behaves_like 'getting tag messages' + + it 'gets messages in one batch', :request_store do + expect { subject.map(&:itself) }.to change { Gitlab::GitalyClient.get_request_count }.by(1) + end end - it 'gets messages in one batch', :request_store do - expect { subject.map(&:itself) }.to change { Gitlab::GitalyClient.get_request_count }.by(1) + context 'when Gitaly tag_messages feature is disabled', :disable_gitaly do + it_behaves_like 'getting tag messages' end end |