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
Léo-Paul Géneau
gitlab-ce
Commits
4aaf3dae
Commit
4aaf3dae
authored
Jan 12, 2018
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use an at_exit hook to stop test gitaly
parent
cc18608d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
spec/spec_helper.rb
spec/spec_helper.rb
+0
-4
spec/support/test_env.rb
spec/support/test_env.rb
+3
-5
No files found.
spec/spec_helper.rb
View file @
4aaf3dae
...
@@ -97,10 +97,6 @@ RSpec.configure do |config|
...
@@ -97,10 +97,6 @@ RSpec.configure do |config|
TestEnv
.
init
TestEnv
.
init
end
end
config
.
after
(
:suite
)
do
TestEnv
.
cleanup
end
config
.
before
(
:example
)
do
config
.
before
(
:example
)
do
# Skip pre-receive hook check so we can use the web editor and merge.
# Skip pre-receive hook check so we can use the web editor and merge.
allow_any_instance_of
(
Gitlab
::
Git
::
Hook
).
to
receive
(
:trigger
).
and_return
([
true
,
nil
])
allow_any_instance_of
(
Gitlab
::
Git
::
Hook
).
to
receive
(
:trigger
).
and_return
([
true
,
nil
])
...
...
spec/support/test_env.rb
View file @
4aaf3dae
...
@@ -90,10 +90,6 @@ module TestEnv
...
@@ -90,10 +90,6 @@ module TestEnv
setup_forked_repo
setup_forked_repo
end
end
def
cleanup
stop_gitaly
end
def
disable_mailer
def
disable_mailer
allow_any_instance_of
(
NotificationService
).
to
receive
(
:mailer
)
allow_any_instance_of
(
NotificationService
).
to
receive
(
:mailer
)
.
and_return
(
double
.
as_null_object
)
.
and_return
(
double
.
as_null_object
)
...
@@ -163,6 +159,8 @@ module TestEnv
...
@@ -163,6 +159,8 @@ module TestEnv
spawn_script
=
Rails
.
root
.
join
(
'scripts/gitaly-test-spawn'
).
to_s
spawn_script
=
Rails
.
root
.
join
(
'scripts/gitaly-test-spawn'
).
to_s
@gitaly_pid
=
Bundler
.
with_original_env
{
IO
.
popen
([
spawn_script
],
&
:read
).
to_i
}
@gitaly_pid
=
Bundler
.
with_original_env
{
IO
.
popen
([
spawn_script
],
&
:read
).
to_i
}
Kernel
.
at_exit
{
stop_gitaly
}
wait_gitaly
wait_gitaly
end
end
...
@@ -309,7 +307,7 @@ module TestEnv
...
@@ -309,7 +307,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.
clean
up
&&
clean
_gitlab_test_path
&&
init
unless
reset
.
call
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