summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-08-28 18:42:22 +0200
committerJacob Vosmaer <jacob@gitlab.com>2018-08-28 18:42:22 +0200
commit633a7d87a4643b41efe60fc348582f8f98c12345 (patch)
treec87f6a008e058637d23f51dfd80934c92fb836d9 /spec/tasks
parentb64ba567ff4409a9e10f764297ea110023d4aec8 (diff)
downloadgitlab-ce-ignore-custom-hooks-error.tar.gz
WIP ignore custom hooks restore errorignore-custom-hooks-error
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 3ba6caf1337..3ddd3f9a91e 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -150,6 +150,20 @@ describe 'gitlab:app namespace rake task' do
end
expect(Dir.entries(File.join(repo_path, 'custom_hooks'))).to include("dummy.txt")
end
+
+context 'when custom_hooks.tar is invalid (gitlab-ce#50667)' do
+ it 'ignores the error' do
+ expect { run_rake_task('gitlab:backup:create') }.to output.to_stdout
+allow_any_instance_of(Gitlab::GitalyClient::RepositoryService).to receive(:restore_custom_hooks).and_raise('restore custom hooks failed')
+ #expect {
+ run_rake_task('gitlab:backup:restore') #}.to output.to_stdout
+
+ repo_path = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ project.repository.path
+ end
+ expect(File.exist?(File.join(repo_path, 'custom_hooks'))).to be_false
+ end
+end
end
context 'specific backup tasks' do