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

Merge branch 'backup_restore_skip' into 'master'

Allow restore tasks to be skipped using SKIP

See merge request gitlab-org/gitlab!83783
parents f8a77af7 480f737e
......@@ -389,7 +389,8 @@ module Backup
end
def skipped?(item)
backup_information[:skipped] && backup_information[:skipped].include?(item)
ENV.fetch('SKIP', '').include?(item) ||
backup_information[:skipped] && backup_information[:skipped].include?(item)
end
def enabled_task?(task_name)
......
......@@ -228,6 +228,20 @@ RSpec.describe Backup::Manager do
end
end
context 'when SKIP env is set' do
let(:expected_backup_contents) { %w{backup_information.yml task1.tar.gz} }
before do
stub_env('SKIP', 'task2')
end
it 'executes tar' do
subject.create # rubocop:disable Rails/SaveBang
expect(Kernel).to have_received(:system).with(*tar_cmdline)
end
end
context 'when the destination is optional' do
let(:expected_backup_contents) { %w{backup_information.yml task1.tar.gz} }
let(:definitions) do
......
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