summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-23 10:17:07 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-23 14:18:39 -0500
commit12bd78103153fce845eed1566918083b52e814df (patch)
tree1cf329a537518503b54cde6edcc78f00a23bae65 /spec/tasks
parent3c18a4f8aaf88dcea8c22995814057d1885c654c (diff)
downloadgitlab-ce-12bd78103153fce845eed1566918083b52e814df.tar.gz
Fix backups if registry is disabled
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 8aeb013eec6..25da0917134 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -2,6 +2,8 @@ require 'spec_helper'
require 'rake'
describe 'gitlab:app namespace rake task' do
+ let(:enable_registry) { true }
+
before :all do
Rake.application.rake_require 'tasks/gitlab/task_helpers'
Rake.application.rake_require 'tasks/gitlab/backup'
@@ -15,6 +17,10 @@ describe 'gitlab:app namespace rake task' do
FileUtils.mkdir_p('public/uploads')
end
+ before do
+ stub_container_registry_config(enabled: enable_registry)
+ end
+
def run_rake_task(task_name)
Rake::Task[task_name].reenable
Rake.application.invoke_task task_name
@@ -143,6 +149,18 @@ describe 'gitlab:app namespace rake task' do
expect(temp_dirs).to be_empty
end
+
+ context 'registry disabled' do
+ let(:enable_registry) { false }
+
+ it 'should not create registry.tar.gz' do
+ tar_contents, exit_status = Gitlab::Popen.popen(
+ %W{tar -tvf #{@backup_tar}}
+ )
+ expect(exit_status).to eq(0)
+ expect(tar_contents).not_to match('registry.tar.gz')
+ end
+ end
end # backup_create task
describe "Skipping items" do