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
d0b08f1c
Commit
d0b08f1c
authored
Jan 22, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GitLab Runner service to GitLab QA
parent
63dbcd24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
3 deletions
+77
-3
qa/qa.rb
qa/qa.rb
+6
-3
qa/qa/service/omnibus.rb
qa/qa/service/omnibus.rb
+20
-0
qa/qa/service/runner.rb
qa/qa/service/runner.rb
+28
-0
qa/qa/service/shellout.rb
qa/qa/service/shellout.rb
+23
-0
No files found.
qa/qa.rb
View file @
d0b08f1c
...
...
@@ -126,10 +126,13 @@ module QA
end
##
# Classes describing shell interaction with GitLab
# Classes describing services being part of GitLab and how we can interact
# with these services, like through the shell.
#
module
Shell
autoload
:Omnibus
,
'qa/shell/omnibus'
module
Service
autoload
:Shellable
,
'qa/service/shellable'
autoload
:Omnibus
,
'qa/service/omnibus'
autoload
:Runner
,
'qa/service/runner'
end
##
...
...
qa/qa/service/omnibus.rb
0 → 100644
View file @
d0b08f1c
module
QA
module
Service
class
Omnibus
include
Scenario
::
Actable
include
Service
::
Shellout
def
initialize
(
container
)
@name
=
container
end
def
gitlab_ctl
(
command
,
input:
nil
)
if
input
.
nil?
shell
"docker exec
#{
@name
}
gitlab-ctl
#{
command
}
"
else
shell
"docker exec
#{
@name
}
bash -c '
#{
input
}
| gitlab-ctl
#{
command
}
'"
end
end
end
end
end
qa/qa/service/runner.rb
0 → 100644
View file @
d0b08f1c
module
QA
module
Service
class
Runner
include
Scenario
::
Actable
include
Service
::
Shellout
def
initialize
(
image
)
@image
=
image
end
def
pull
shell
"docker pull
#{
@image
}
"
end
def
register
(
token
)
raise
NotImplementedError
end
def
run
raise
NotImplementedError
end
def
remove
raise
NotImplementedError
end
end
end
end
qa/qa/s
hell/omnibus
.rb
→
qa/qa/s
ervice/shellout
.rb
View file @
d0b08f1c
require
'open3'
module
QA
module
Shell
class
Omnibus
include
Scenario
::
Actable
def
initialize
(
container
)
@name
=
container
end
def
gitlab_ctl
(
command
,
input:
nil
)
if
input
.
nil?
shell
"docker exec
#{
@name
}
gitlab-ctl
#{
command
}
"
else
shell
"docker exec
#{
@name
}
bash -c '
#{
input
}
| gitlab-ctl
#{
command
}
'"
end
end
private
module
Service
module
Shellout
##
# TODO, make it possible to use generic QA framework classes
# as a library - gitlab-org/gitlab-qa#94
...
...
@@ -30,7 +14,7 @@ module QA
out
.
each
{
|
line
|
puts
line
}
if
wait
.
value
.
exited?
&&
wait
.
value
.
exitstatus
.
nonzero?
raise
"
Docker c
ommand `
#{
command
}
` failed!"
raise
"
C
ommand `
#{
command
}
` failed!"
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