BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
62f053e4
Unverified
Commit
62f053e4
authored
Mar 05, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update runner registration API
parent
d02694c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
runner.rb
lib/api/runner.rb
+3
-2
runner_spec.rb
spec/requests/api/runner_spec.rb
+2
-2
No files found.
lib/api/runner.rb
View file @
62f053e4
...
...
@@ -14,11 +14,12 @@ module API
optional
:locked
,
type:
Boolean
,
desc:
'Should Runner be locked for current project'
optional
:run_untagged
,
type:
Boolean
,
desc:
'Should Runner handle untagged jobs'
optional
:tag_list
,
type:
Array
[
String
],
desc:
%q(List of Runner's tags)
optional
:maximum_job_timeout
_human_readable
,
type:
String
,
desc:
'Maximum timeout set when this Runner will handle the job'
optional
:maximum_job_timeout
,
type:
String
,
desc:
'Maximum timeout set when this Runner will handle the job'
end
post
'/'
do
attributes
=
attributes_for_keys
([
:description
,
:locked
,
:run_untagged
,
:tag_list
,
:maximum_job_timeout_human_readable
])
attributes
=
attributes_for_keys
([
:description
,
:locked
,
:run_untagged
,
:tag_list
])
.
merge
(
get_runner_details_from_request
)
.
merge
(
maximum_job_timeout_human_readable:
params
[
:maximum_job_timeout
])
runner
=
if
runner_registration_token_valid?
...
...
spec/requests/api/runner_spec.rb
View file @
62f053e4
...
...
@@ -112,7 +112,7 @@ describe API::Runner do
context
'when maximum job timeout is specified'
do
it
'creates runner'
do
post
api
(
'/runners'
),
token:
registration_token
,
maximum_job_timeout
_human_readable
:
'2h 30m'
maximum_job_timeout:
'2h 30m'
expect
(
response
).
to
have_gitlab_http_status
201
expect
(
Ci
::
Runner
.
first
.
maximum_job_timeout
).
to
eq
(
9000
)
...
...
@@ -121,7 +121,7 @@ describe API::Runner do
context
'when maximum job timeout is empty'
do
it
'creates runner'
do
post
api
(
'/runners'
),
token:
registration_token
,
maximum_job_timeout
_human_readable
:
''
maximum_job_timeout:
''
expect
(
response
).
to
have_gitlab_http_status
201
expect
(
Ci
::
Runner
.
first
.
maximum_job_timeout
).
to
be_nil
...
...
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