Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 03:09:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 03:09:34 +0300
commit3cd08f4bf96cda3e9d3abf233095107832b17c20 (patch)
treedc09a618783a79d70f2a404374d4b850ccf9cc84 /spec/support/shared_examples/services
parentdd4bee69b7d55620f7dc9db8c36b478bd4959755 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/services')
-rw-r--r--spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb32
1 files changed, 17 insertions, 15 deletions
diff --git a/spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb b/spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb
index 6f83f52d54b..e30c620c4b1 100644
--- a/spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb
+++ b/spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb
@@ -22,14 +22,13 @@ RSpec.shared_examples 'moves repository to another storage' do |repository_type|
context 'when the move succeeds', :clean_gitlab_redis_shared_state do
before do
- allow(project_repository_double).to receive(:fetch_repository_as_mirror)
+ allow(project_repository_double).to receive(:replicate)
.with(project.repository.raw)
- .and_return(true)
allow(project_repository_double).to receive(:checksum)
.and_return(project_repository_checksum)
- allow(repository_double).to receive(:fetch_repository_as_mirror)
- .with(repository.raw).and_return(true)
+ allow(repository_double).to receive(:replicate)
+ .with(repository.raw)
allow(repository_double).to receive(:checksum)
.and_return(repository_checksum)
end
@@ -82,20 +81,23 @@ RSpec.shared_examples 'moves repository to another storage' do |repository_type|
context 'when the project is already on the target storage' do
it 'bails out and does nothing' do
- expect do
- subject.execute(project.repository_storage)
- end.to raise_error(described_class::RepositoryAlreadyMoved)
+ result = subject.execute(project.repository_storage)
+
+ expect(result[:status]).to eq(:error)
+ expect(result[:message]).to match(/repository and source have the same storage/)
end
end
context "when the move of the #{repository_type} repository fails" do
it 'unmarks the repository as read-only without updating the repository storage' do
- allow(project_repository_double).to receive(:fetch_repository_as_mirror)
- .with(project.repository.raw).and_return(true)
+ allow(project_repository_double).to receive(:replicate)
+ .with(project.repository.raw)
allow(project_repository_double).to receive(:checksum)
.and_return(project_repository_checksum)
- allow(repository_double).to receive(:fetch_repository_as_mirror)
- .with(repository.raw).and_return(false)
+
+ allow(repository_double).to receive(:replicate)
+ .with(repository.raw)
+ .and_raise(Gitlab::Git::CommandError)
expect(GitlabShellWorker).not_to receive(:perform_async)
@@ -109,13 +111,13 @@ RSpec.shared_examples 'moves repository to another storage' do |repository_type|
context "when the checksum of the #{repository_type} repository does not match" do
it 'unmarks the repository as read-only without updating the repository storage' do
- allow(project_repository_double).to receive(:fetch_repository_as_mirror)
- .with(project.repository.raw).and_return(true)
+ allow(project_repository_double).to receive(:replicate)
+ .with(project.repository.raw)
allow(project_repository_double).to receive(:checksum)
.and_return(project_repository_checksum)
- allow(repository_double).to receive(:fetch_repository_as_mirror)
- .with(repository.raw).and_return(true)
+ allow(repository_double).to receive(:replicate)
+ .with(repository.raw)
allow(repository_double).to receive(:checksum)
.and_return('not matching checksum')