| ... | ... | @@ -22,11 +22,15 @@ 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(:create_repository)
|
|
|
|
.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(:create_repository)
|
|
|
|
.and_return(true)
|
|
|
|
allow(repository_double).to receive(:replicate)
|
|
|
|
.with(repository.raw)
|
|
|
|
allow(repository_double).to receive(:checksum)
|
| ... | ... | @@ -90,11 +94,15 @@ RSpec.shared_examples 'moves repository to another storage' do |repository_type| |
|
|
|
|
|
|
|
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(:create_repository)
|
|
|
|
.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(:create_repository)
|
|
|
|
.and_return(true)
|
|
|
|
allow(repository_double).to receive(:replicate)
|
|
|
|
.with(repository.raw)
|
|
|
|
.and_raise(Gitlab::Git::CommandError)
|
| ... | ... | @@ -111,11 +119,15 @@ 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(:create_repository)
|
|
|
|
.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(:create_repository)
|
|
|
|
.and_return(true)
|
|
|
|
allow(repository_double).to receive(:replicate)
|
|
|
|
.with(repository.raw)
|
|
|
|
allow(repository_double).to receive(:checksum)
|
| ... | ... | |
| ... | ... | |