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
Boxiang Sun
gitlab-ce
Commits
068defa7
Commit
068defa7
authored
Jul 11, 2018
by
gfyoung
Committed by
Rémy Coutable
Jul 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing maximum_timeout parameter
parent
e68a547b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
1 deletion
+69
-1
changelogs/unreleased/runners-max-timeout-param.yml
changelogs/unreleased/runners-max-timeout-param.yml
+5
-0
lib/api/runners.rb
lib/api/runners.rb
+1
-1
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+63
-0
No files found.
changelogs/unreleased/runners-max-timeout-param.yml
0 → 100644
View file @
068defa7
---
title
:
Add missing maximum_timeout parameter
merge_request
:
20355
author
:
gfyoung
type
:
fixed
lib/api/runners.rb
View file @
068defa7
...
@@ -58,7 +58,7 @@ module API
...
@@ -58,7 +58,7 @@ module API
optional
:access_level
,
type:
String
,
values:
Ci
::
Runner
.
access_levels
.
keys
,
optional
:access_level
,
type:
String
,
values:
Ci
::
Runner
.
access_levels
.
keys
,
desc:
'The access_level of the runner'
desc:
'The access_level of the runner'
optional
:maximum_timeout
,
type:
Integer
,
desc:
'Maximum timeout set when this Runner will handle the job'
optional
:maximum_timeout
,
type:
Integer
,
desc:
'Maximum timeout set when this Runner will handle the job'
at_least_one_of
:description
,
:active
,
:tag_list
,
:run_untagged
,
:locked
,
:access_level
at_least_one_of
:description
,
:active
,
:tag_list
,
:run_untagged
,
:locked
,
:access_level
,
:maximum_timeout
end
end
put
':id'
do
put
':id'
do
runner
=
get_runner
(
params
.
delete
(
:id
))
runner
=
get_runner
(
params
.
delete
(
:id
))
...
...
spec/requests/api/runners_spec.rb
View file @
068defa7
...
@@ -211,6 +211,69 @@ describe API::Runners do
...
@@ -211,6 +211,69 @@ describe API::Runners do
describe
'PUT /runners/:id'
do
describe
'PUT /runners/:id'
do
context
'admin user'
do
context
'admin user'
do
# see https://gitlab.com/gitlab-org/gitlab-ce/issues/48625
context
'single parameter update'
do
it
'runner description'
do
description
=
shared_runner
.
description
update_runner
(
shared_runner
.
id
,
admin
,
description:
"
#{
description
}
_updated"
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
description
).
to
eq
(
"
#{
description
}
_updated"
)
end
it
'runner active state'
do
active
=
shared_runner
.
active
update_runner
(
shared_runner
.
id
,
admin
,
active:
!
active
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
active
).
to
eq
(
!
active
)
end
it
'runner tag list'
do
update_runner
(
shared_runner
.
id
,
admin
,
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
])
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
tag_list
).
to
include
(
'ruby2.1'
,
'pgsql'
,
'mysql'
)
end
it
'runner untagged flag'
do
# Ensure tag list is non-empty before setting untagged to false.
update_runner
(
shared_runner
.
id
,
admin
,
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
])
update_runner
(
shared_runner
.
id
,
admin
,
run_untagged:
'false'
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
run_untagged?
).
to
be
(
false
)
end
it
'runner unlocked flag'
do
update_runner
(
shared_runner
.
id
,
admin
,
locked:
'true'
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
locked?
).
to
be
(
true
)
end
it
'runner access level'
do
update_runner
(
shared_runner
.
id
,
admin
,
access_level:
'ref_protected'
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
ref_protected?
).
to
be_truthy
end
it
'runner maximum timeout'
do
update_runner
(
shared_runner
.
id
,
admin
,
maximum_timeout:
1234
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
shared_runner
.
reload
.
maximum_timeout
).
to
eq
(
1234
)
end
it
'fails with no parameters'
do
put
api
(
"/runners/
#{
shared_runner
.
id
}
"
,
admin
)
shared_runner
.
reload
expect
(
response
).
to
have_gitlab_http_status
(
400
)
end
end
context
'when runner is shared'
do
context
'when runner is shared'
do
it
'updates runner'
do
it
'updates runner'
do
description
=
shared_runner
.
description
description
=
shared_runner
.
description
...
...
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