summaryrefslogtreecommitdiff
path: root/spec/tasks/gitlab
diff options
context:
space:
mode:
authorauthor Jacob Vosmaer jacob@gitlab.com 1490710538 +0200 <author Jacob Vosmaer jacob@gitlab.com 1490710538 +0200>2017-03-28 16:15:38 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-03-29 14:48:06 +0200
commit6b8c2ea866c387e9a8a1ccdc079ecebad9509897 (patch)
tree4f92fc0b53af63959d3931c05004226bd086caa1 /spec/tasks/gitlab
parent1904c80f3dd5437cb39aa90de933279bf9635678 (diff)
downloadgitlab-ce-6b8c2ea866c387e9a8a1ccdc079ecebad9509897.tar.gz
Allow backup tests to run locally
Diffstat (limited to 'spec/tasks/gitlab')
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index adb4ae8bbe9..665c8fe556a 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -81,6 +81,10 @@ describe 'gitlab:app namespace rake task' do
end # backup_restore task
describe 'backup' do
+ before(:all) do
+ ENV['force'] = 'yes'
+ end
+
def tars_glob
Dir.glob(File.join(Gitlab.config.backup.path, '*_gitlab_backup.tar'))
end
@@ -88,6 +92,9 @@ describe 'gitlab:app namespace rake task' do
def create_backup
FileUtils.rm tars_glob
+ # This reconnect makes our project fixture disappear, breaking the restore. Stub it out.
+ allow(ActiveRecord::Base.connection).to receive(:reconnect!)
+
# Redirect STDOUT and run the rake task
orig_stdout = $stdout
$stdout = StringIO.new
@@ -119,9 +126,6 @@ describe 'gitlab:app namespace rake task' do
FileUtils.mkdir_p(path)
FileUtils.touch(File.join(path, "dummy.txt"))
- # We need to use the full path instead of the relative one
- allow(Gitlab.config.gitlab_shell).to receive(:path).and_return(File.expand_path(Gitlab.config.gitlab_shell.path, Rails.root.to_s))
-
ENV["SKIP"] = "db"
create_backup
end