Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
nexedi
gitlab-shell
Commits
5043d13b
Commit
5043d13b
authored
Nov 16, 2016
by
Elan Ruusamäe
Committed by
Sean McGivern
Dec 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup dirs in before to fixup aborted tests
parent
17691041
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
spec/gitlab_custom_hook_spec.rb
spec/gitlab_custom_hook_spec.rb
+10
-4
No files found.
spec/gitlab_custom_hook_spec.rb
View file @
5043d13b
...
...
@@ -45,6 +45,13 @@ describe GitlabCustomHook do
create_hook
(
path
,
'custom_hooks/post-receive.d/hook'
,
which
)
end
def
cleanup_hook_setup
FileUtils
.
rm_rf
(
File
.
join
(
tmp_repo_path
,
'custom_hooks'
))
FileUtils
.
rm_rf
(
File
.
join
(
tmp_repo_path
,
'hooks'
))
FileUtils
.
rm_rf
(
File
.
join
(
tmp_repo_path
,
'hooks.d'
))
FileUtils
.
rm_rf
(
File
.
join
(
tmp_root_path
,
'hooks'
))
end
# setup paths
# <repository>.git/hooks/ - symlink to gitlab-shell/hooks global dir
# <repository>.git/hooks/<hook_name> - executed by git itself, this is gitlab-shell/hooks/<hook_name>
...
...
@@ -56,6 +63,8 @@ describe GitlabCustomHook do
# as global scripts are ran first, failing global skips repo hooks
before
do
cleanup_hook_setup
FileUtils
.
mkdir_p
(
File
.
join
(
tmp_root_path
,
'hooks'
))
FileUtils
.
mkdir_p
(
File
.
join
(
tmp_root_path
,
'hooks'
,
'update.d'
))
FileUtils
.
mkdir_p
(
File
.
join
(
tmp_root_path
,
'hooks'
,
'pre-receive.d'
))
...
...
@@ -69,10 +78,7 @@ describe GitlabCustomHook do
end
after
do
FileUtils
.
rm_rf
(
File
.
join
(
tmp_repo_path
,
'custom_hooks'
))
FileUtils
.
rm_rf
(
File
.
join
(
tmp_repo_path
,
'hooks'
))
FileUtils
.
rm_rf
(
File
.
join
(
tmp_repo_path
,
'hooks.d'
))
FileUtils
.
rm_rf
(
File
.
join
(
tmp_root_path
,
'hooks'
))
cleanup_hook_setup
end
context
'with gl_id_test_hook'
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