Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
39a7e210
Commit
39a7e210
authored
Jul 24, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a separate backup test directory and nuke its contents
parent
db0fce32
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
config/gitlab.yml.example
config/gitlab.yml.example
+2
-0
spec/support/test_env.rb
spec/support/test_env.rb
+5
-0
spec/tasks/gitlab/backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+4
-6
No files found.
config/gitlab.yml.example
View file @
39a7e210
...
@@ -339,6 +339,8 @@ test:
...
@@ -339,6 +339,8 @@ test:
# user: YOUR_USERNAME
# user: YOUR_USERNAME
satellites:
satellites:
path: tmp/tests/gitlab-satellites/
path: tmp/tests/gitlab-satellites/
backup:[B
path: tmp/tests/backups
gitlab_shell:
gitlab_shell:
path: tmp/tests/gitlab-shell/
path: tmp/tests/gitlab-shell/
repos_path: tmp/tests/repositories/
repos_path: tmp/tests/repositories/
...
...
spec/support/test_env.rb
View file @
39a7e210
...
@@ -29,6 +29,7 @@ module TestEnv
...
@@ -29,6 +29,7 @@ module TestEnv
clean_test_path
clean_test_path
FileUtils
.
mkdir_p
(
repos_path
)
FileUtils
.
mkdir_p
(
repos_path
)
FileUtils
.
mkdir_p
(
backup_path
)
# Setup GitLab shell for test instance
# Setup GitLab shell for test instance
setup_gitlab_shell
setup_gitlab_shell
...
@@ -121,6 +122,10 @@ module TestEnv
...
@@ -121,6 +122,10 @@ module TestEnv
Gitlab
.
config
.
gitlab_shell
.
repos_path
Gitlab
.
config
.
gitlab_shell
.
repos_path
end
end
def
backup_path
Gitlab
.
config
.
backup
.
path
end
def
copy_forked_repo_with_submodules
(
project
)
def
copy_forked_repo_with_submodules
(
project
)
base_repo_path
=
File
.
expand_path
(
forked_repo_path_bare
)
base_repo_path
=
File
.
expand_path
(
forked_repo_path_bare
)
target_repo_path
=
File
.
expand_path
(
repos_path
+
"/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
.git"
)
target_repo_path
=
File
.
expand_path
(
repos_path
+
"/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
.git"
)
...
...
spec/tasks/gitlab/backup_rake_spec.rb
View file @
39a7e210
...
@@ -67,8 +67,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -67,8 +67,7 @@ describe 'gitlab:app namespace rake task' do
end
end
def
create_backup
def
create_backup
# Record the existing backup tars so we don't touch them
FileUtils
.
rm
tars_glob
existing_tars
=
tars_glob
# Redirect STDOUT and run the rake task
# Redirect STDOUT and run the rake task
orig_stdout
=
$stdout
orig_stdout
=
$stdout
...
@@ -78,7 +77,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -78,7 +77,7 @@ describe 'gitlab:app namespace rake task' do
reenable_backup_sub_tasks
reenable_backup_sub_tasks
$stdout
=
orig_stdout
$stdout
=
orig_stdout
@backup_tar
=
(
tars_glob
-
existing_tars
)
.
first
@backup_tar
=
tars_glob
.
first
end
end
before
do
before
do
...
@@ -140,8 +139,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -140,8 +139,7 @@ describe 'gitlab:app namespace rake task' do
reenable_backup_sub_tasks
reenable_backup_sub_tasks
# Record the existing backup tars so we don't touch them
FileUtils
.
rm
tars_glob
existing_tars
=
tars_glob
# Redirect STDOUT and run the rake task
# Redirect STDOUT and run the rake task
orig_stdout
=
$stdout
orig_stdout
=
$stdout
...
@@ -150,7 +148,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -150,7 +148,7 @@ describe 'gitlab:app namespace rake task' do
run_rake_task
(
'gitlab:backup:create'
)
run_rake_task
(
'gitlab:backup:create'
)
$stdout
=
orig_stdout
$stdout
=
orig_stdout
@backup_tar
=
(
tars_glob
-
existing_tars
)
.
first
@backup_tar
=
tars_glob
.
first
end
end
after
:all
do
after
:all
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment