diff options
author | Rémy Coutable <remy@rymai.me> | 2017-04-12 09:25:09 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-12 09:25:09 +0000 |
commit | c43f7d4713a719d7090d7ec5fbe4a36d233282ad (patch) | |
tree | 7a74a7669a0ed8c84af7dfea532c5e1b79775513 /spec/models | |
parent | 3842b654030cfbc590936f0836b3c380aebf4442 (diff) | |
parent | d6cc8feb6ce0a8e39a1bc8830b932155713357da (diff) | |
download | gitlab-ce-c43f7d4713a719d7090d7ec5fbe4a36d233282ad.tar.gz |
Merge branch 'gitaly-testing' into 'master'
Setup and run a Gitaly server for testing if GitalyClient is enabled
See merge request !10298
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/commit_spec.rb | 55 | ||||
-rw-r--r-- | spec/models/environment_spec.rb | 23 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 25 |
3 files changed, 53 insertions, 50 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 980a1b70ef5..ce31c8ed94c 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -389,31 +389,32 @@ eos end end - describe '#raw_diffs' do - context 'Gitaly commit_raw_diffs feature enabled' do - before do - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:commit_raw_diffs).and_return(true) - end - - context 'when a truthy deltas_only is not passed to args' do - it 'fetches diffs from Gitaly server' do - expect(Gitlab::GitalyClient::Commit).to receive(:diff_from_parent). - with(commit) - - commit.raw_diffs - end - end - - context 'when a truthy deltas_only is passed to args' do - it 'fetches diffs using Rugged' do - opts = { deltas_only: true } - - expect(Gitlab::GitalyClient::Commit).not_to receive(:diff_from_parent) - expect(commit.raw).to receive(:diffs).with(opts) - - commit.raw_diffs(opts) - end - end - end - end + # describe '#raw_diffs' do + # TODO: Uncomment when feature is reenabled + # context 'Gitaly commit_raw_diffs feature enabled' do + # before do + # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:commit_raw_diffs).and_return(true) + # end + # + # context 'when a truthy deltas_only is not passed to args' do + # it 'fetches diffs from Gitaly server' do + # expect(Gitlab::GitalyClient::Commit).to receive(:diff_from_parent). + # with(commit) + # + # commit.raw_diffs + # end + # end + # + # context 'when a truthy deltas_only is passed to args' do + # it 'fetches diffs using Rugged' do + # opts = { deltas_only: true } + # + # expect(Gitlab::GitalyClient::Commit).not_to receive(:diff_from_parent) + # expect(commit.raw).to receive(:diffs).with(opts) + # + # commit.raw_diffs(opts) + # end + # end + # end + # end end diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index af7753caba6..070716e859a 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -110,17 +110,18 @@ describe Environment, models: true do end end - context 'Gitaly find_ref_name feature enabled' do - before do - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:find_ref_name).and_return(true) - end - - it 'calls GitalyClient' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:find_ref_name) - - environment.first_deployment_for(commit) - end - end + # TODO: Uncomment when feature is reenabled + # context 'Gitaly find_ref_name feature enabled' do + # before do + # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:find_ref_name).and_return(true) + # end + # + # it 'calls GitalyClient' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:find_ref_name) + # + # environment.first_deployment_for(commit) + # end + # end end describe '#environment_type' do diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 8bd436558cb..5e5c2b016b6 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1829,16 +1829,17 @@ describe Repository, models: true do end end - describe '#is_ancestor?' do - context 'Gitaly is_ancestor feature enabled' do - it 'asks Gitaly server if it\'s an ancestor' do - commit = repository.commit - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) - expect(Gitlab::GitalyClient::Commit).to receive(:is_ancestor). - with(repository.raw_repository, commit.id, commit.id).and_return(true) - - expect(repository.is_ancestor?(commit.id, commit.id)).to be true - end - end - end + # TODO: Uncomment when feature is reenabled + # describe '#is_ancestor?' do + # context 'Gitaly is_ancestor feature enabled' do + # it 'asks Gitaly server if it\'s an ancestor' do + # commit = repository.commit + # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) + # expect(Gitlab::GitalyClient::Commit).to receive(:is_ancestor). + # with(repository.raw_repository, commit.id, commit.id).and_return(true) + # + # expect(repository.is_ancestor?(commit.id, commit.id)).to be true + # end + # end + # end end |