Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/gitlab.yml.example2
-rw-r--r--spec/support/test_env.rb5
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb10
3 files changed, 11 insertions, 6 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 542106e86dd..456fb3d636e 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -339,6 +339,8 @@ test:
# user: YOUR_USERNAME
satellites:
path: tmp/tests/gitlab-satellites/
+ backup:
+ path: tmp/tests/backups
gitlab_shell:
path: tmp/tests/gitlab-shell/
repos_path: tmp/tests/repositories/
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index 8bdd6b43cdd..2bdb64ff314 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -29,6 +29,7 @@ module TestEnv
clean_test_path
FileUtils.mkdir_p(repos_path)
+ FileUtils.mkdir_p(backup_path)
# Setup GitLab shell for test instance
setup_gitlab_shell
@@ -121,6 +122,10 @@ module TestEnv
Gitlab.config.gitlab_shell.repos_path
end
+ def backup_path
+ Gitlab.config.backup.path
+ end
+
def copy_forked_repo_with_submodules(project)
base_repo_path = File.expand_path(forked_repo_path_bare)
target_repo_path = File.expand_path(repos_path + "/#{project.namespace.path}/#{project.path}.git")
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 48d08031d29..23f322e0a62 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -67,8 +67,7 @@ describe 'gitlab:app namespace rake task' do
end
def create_backup
- # Record the existing backup tars so we don't touch them
- existing_tars = tars_glob
+ FileUtils.rm tars_glob
# Redirect STDOUT and run the rake task
orig_stdout = $stdout
@@ -78,7 +77,7 @@ describe 'gitlab:app namespace rake task' do
reenable_backup_sub_tasks
$stdout = orig_stdout
- @backup_tar = (tars_glob - existing_tars).first
+ @backup_tar = tars_glob.first
end
before do
@@ -140,8 +139,7 @@ describe 'gitlab:app namespace rake task' do
reenable_backup_sub_tasks
- # Record the existing backup tars so we don't touch them
- existing_tars = tars_glob
+ FileUtils.rm tars_glob
# Redirect STDOUT and run the rake task
orig_stdout = $stdout
@@ -150,7 +148,7 @@ describe 'gitlab:app namespace rake task' do
run_rake_task('gitlab:backup:create')
$stdout = orig_stdout
- @backup_tar = (tars_glob - existing_tars).first
+ @backup_tar = tars_glob.first
end
after :all do