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
Jérome Perrin
gitlab-ce
Commits
3cda57b4
Commit
3cda57b4
authored
Jun 06, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actually clean gitlab-test path when TestEnv.set_repo_refs fails
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
606e9cef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
spec/support/test_env.rb
spec/support/test_env.rb
+12
-4
No files found.
spec/support/test_env.rb
View file @
3cda57b4
...
@@ -54,6 +54,8 @@ module TestEnv
...
@@ -54,6 +54,8 @@ module TestEnv
'conflict-resolvable-fork'
=>
'404fa3f'
'conflict-resolvable-fork'
=>
'404fa3f'
}.
freeze
}.
freeze
TMP_TEST_PATH
=
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'**'
)
# Test environment
# Test environment
#
#
# See gitlab.yml.example test section for paths
# See gitlab.yml.example test section for paths
...
@@ -98,9 +100,7 @@ module TestEnv
...
@@ -98,9 +100,7 @@ module TestEnv
#
#
# Keeps gitlab-shell and gitlab-test
# Keeps gitlab-shell and gitlab-test
def
clean_test_path
def
clean_test_path
tmp_test_path
=
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'**'
)
Dir
[
TMP_TEST_PATH
].
each
do
|
entry
|
Dir
[
tmp_test_path
].
each
do
|
entry
|
unless
File
.
basename
(
entry
)
=~
/\A(gitaly|gitlab-(shell|test|test_bare|test-fork|test-fork_bare))\z/
unless
File
.
basename
(
entry
)
=~
/\A(gitaly|gitlab-(shell|test|test_bare|test-fork|test-fork_bare))\z/
FileUtils
.
rm_rf
(
entry
)
FileUtils
.
rm_rf
(
entry
)
end
end
...
@@ -111,6 +111,14 @@ module TestEnv
...
@@ -111,6 +111,14 @@ module TestEnv
FileUtils
.
mkdir_p
(
pages_path
)
FileUtils
.
mkdir_p
(
pages_path
)
end
end
def
clean_gitlab_test_path
Dir
[
TMP_TEST_PATH
].
each
do
|
entry
|
if
File
.
basename
(
entry
)
=~
/\A(gitlab-(test|test_bare|test-fork|test-fork_bare))\z/
FileUtils
.
rm_rf
(
entry
)
end
end
end
def
setup_gitlab_shell
def
setup_gitlab_shell
unless
File
.
directory?
(
Gitlab
.
config
.
gitlab_shell
.
path
)
unless
File
.
directory?
(
Gitlab
.
config
.
gitlab_shell
.
path
)
unless
system
(
'rake'
,
'gitlab:shell:install'
)
unless
system
(
'rake'
,
'gitlab:shell:install'
)
...
@@ -249,7 +257,7 @@ module TestEnv
...
@@ -249,7 +257,7 @@ module TestEnv
# Before we used Git clone's --mirror option, bare repos could end up
# Before we used Git clone's --mirror option, bare repos could end up
# with missing refs, clearing them and retrying should fix the issue.
# with missing refs, clearing them and retrying should fix the issue.
cleanup
&&
init
unless
reset
.
call
cleanup
&&
clean_gitlab_test_path
&&
init
unless
reset
.
call
end
end
end
end
...
...
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