diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-05-24 18:28:23 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-24 18:28:23 +0000 |
commit | ba58a66a55e2270eb46f7429e070d16f77d25b9d (patch) | |
tree | 531bd365d6f35533162b4362fa686a5408065de4 /spec/lib | |
parent | 22139d81cb440fd9c6158d92a37a3944e6bdf556 (diff) | |
parent | 84e6ddb41f581064c9bb66c34341ec7248f1b333 (diff) | |
download | gitlab-ce-ba58a66a55e2270eb46f7429e070d16f77d25b9d.tar.gz |
Merge branch 'migrate-restore-repo-to-gitaly' into 'master'
Use gitaly repository_service.CreateRepositoryFromBundle to restore (rake task)
Closes charts/gitlab#390
See merge request gitlab-org/gitlab-ce!18644
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/backup/repository_spec.rb | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/spec/lib/backup/repository_spec.rb b/spec/lib/backup/repository_spec.rb index 20ea981ec47..a44243ac82d 100644 --- a/spec/lib/backup/repository_spec.rb +++ b/spec/lib/backup/repository_spec.rb @@ -48,14 +48,14 @@ describe Backup::Repository do describe 'command failure' do before do - allow(Gitlab::Popen).to receive(:popen).and_return(['error', 1]) + allow_any_instance_of(Gitlab::Shell).to receive(:create_repository).and_return(false) end context 'hashed storage' do it 'shows the appropriate error' do subject.restore - expect(progress).to have_received(:puts).with("Ignoring error on #{project.full_path} (#{project.disk_path}) - error") + expect(progress).to have_received(:puts).with("[Failed] restoring #{project.full_path} repository") end end @@ -65,33 +65,10 @@ describe Backup::Repository do it 'shows the appropriate error' do subject.restore - expect(progress).to have_received(:puts).with("Ignoring error on #{project.full_path} - error") + expect(progress).to have_received(:puts).with("[Failed] restoring #{project.full_path} repository") end end end - - describe 'folders without permissions' do - before do - allow(FileUtils).to receive(:mv).and_raise(Errno::EACCES) - end - - it 'shows error message' do - expect(subject).to receive(:access_denied_error) - subject.restore - end - end - - describe 'folder that is a mountpoint' do - before do - allow(FileUtils).to receive(:mv).and_raise(Errno::EBUSY) - end - - it 'shows error message' do - expect(subject).to receive(:resource_busy_error).and_call_original - - expect { subject.restore }.to raise_error(/is a mountpoint/) - end - end end describe '#empty_repo?' do |