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
ca4db9d2
Commit
ca4db9d2
authored
Jan 22, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for Runner to register in QA and DRY page objects
parent
50a82f64
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
+19
-10
qa/qa/factory/resource/runner.rb
qa/qa/factory/resource/runner.rb
+6
-3
qa/qa/page/project/settings/runners.rb
qa/qa/page/project/settings/runners.rb
+4
-0
qa/qa/service/runner.rb
qa/qa/service/runner.rb
+6
-2
qa/qa/specs/features/project/pipelines_spec.rb
qa/qa/specs/features/project/pipelines_spec.rb
+3
-5
No files found.
qa/qa/factory/resource/runner.rb
View file @
ca4db9d2
...
@@ -35,12 +35,15 @@ module QA
...
@@ -35,12 +35,15 @@ module QA
runner
.
register!
runner
.
register!
end
end
sleep
5
# TODO, non-blocking waiting for Runner to register.
##
# TODO, refactor to support non-blocking wait time until
# GitLab Runner sucessfully registers itself.
#
sleep
5
settings
.
refresh
settings
.
refresh
settings
.
expand_runners_settings
do
|
runners
|
settings
.
expand_runners_settings
do
|
runners
|
perform
&
.
call
(
runners
)
perform
&
.
call
(
runners
,
runner
)
runner
.
remove!
runner
.
remove!
end
end
end
end
...
...
qa/qa/page/project/settings/runners.rb
View file @
ca4db9d2
...
@@ -12,6 +12,10 @@ module QA
...
@@ -12,6 +12,10 @@ module QA
#
#
all
(
'code'
).
first
.
text
all
(
'code'
).
first
.
text
end
end
def
has_online_runner?
page
.
has_css?
(
'.runner-status-online'
)
end
end
end
end
end
end
end
...
...
qa/qa/service/runner.rb
View file @
ca4db9d2
...
@@ -6,11 +6,11 @@ module QA
...
@@ -6,11 +6,11 @@ module QA
include
Scenario
::
Actable
include
Scenario
::
Actable
include
Service
::
Shellout
include
Service
::
Shellout
attr_
write
r
:token
,
:address
,
:tags
,
:image
,
:name
attr_
accesso
r
:token
,
:address
,
:tags
,
:image
,
:name
def
initialize
def
initialize
@image
=
'gitlab/gitlab-runner:alpine'
@image
=
'gitlab/gitlab-runner:alpine'
@name
=
"
gitlab-runner-qa
-
#{
SecureRandom
.
hex
(
4
)
}
"
@name
=
"
qa-runner
-
#{
SecureRandom
.
hex
(
4
)
}
"
end
end
def
pull
def
pull
...
@@ -18,6 +18,10 @@ module QA
...
@@ -18,6 +18,10 @@ module QA
end
end
def
register!
def
register!
##
# TODO, this assumes that `test` network exists, because we know that
# gitlab-qa environment orchestration tool creates it.
#
shell
<<~
CMD
.
tr
(
"
\n
"
,
' '
)
shell
<<~
CMD
.
tr
(
"
\n
"
,
' '
)
docker run -d --rm --entrypoint=/bin/sh
docker run -d --rm --entrypoint=/bin/sh
--network test --name
#{
@name
}
--network test --name
#{
@name
}
...
...
qa/qa/specs/features/project/pipelines_spec.rb
View file @
ca4db9d2
...
@@ -5,11 +5,9 @@ module QA
...
@@ -5,11 +5,9 @@ module QA
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Factory
::
Resource
::
Runner
.
fabricate!
do
|
runner
|
Factory
::
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
name
=
'my-qa-runner'
runner
.
perform
do
|
page
,
runner
|
expect
(
page
).
to
have_content
(
runner
.
name
)
runner
.
perform
do
|
page
|
expect
(
page
).
to
have_online_runner
expect
(
page
).
to
have_content
(
'my-qa-runner'
)
expect
(
page
).
to
have_css
(
'.runner-status-online'
)
end
end
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