Commit a6878ea2 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch 'gitaly_backup_not_found' into 'master'

Raise exception when gitaly-backup could not be found

See merge request gitlab-org/gitlab!83555
parents 77fc787f eb823f56
......@@ -100,6 +100,8 @@ module Backup
end
def bin_path
raise Error, 'gitaly-backup binary not found and gitaly_backup_path is not configured' unless Gitlab.config.backup.gitaly_backup_path.present?
File.absolute_path(Gitlab.config.backup.gitaly_backup_path)
end
end
......
......@@ -88,6 +88,12 @@ RSpec.describe Backup::GitalyBackup do
expect { subject.finish! }.to raise_error(::Backup::Error, 'gitaly-backup exit status 1')
end
it 'raises when gitaly_backup_path is not set' do
stub_backup_setting(gitaly_backup_path: nil)
expect { subject.start(:create, destination) }.to raise_error(::Backup::Error, 'gitaly-backup binary not found and gitaly_backup_path is not configured')
end
context 'feature flag incremental_repository_backup disabled' do
before do
stub_feature_flags(incremental_repository_backup: false)
......@@ -248,5 +254,11 @@ RSpec.describe Backup::GitalyBackup do
subject.start(:restore, destination)
expect { subject.finish! }.to raise_error(::Backup::Error, 'gitaly-backup exit status 1')
end
it 'raises when gitaly_backup_path is not set' do
stub_backup_setting(gitaly_backup_path: nil)
expect { subject.start(:restore, destination) }.to raise_error(::Backup::Error, 'gitaly-backup binary not found and gitaly_backup_path is not configured')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment