Use raw value of maximum_timeout for Runner registration API

This commit is contained in:
Tomasz Maczukin 2018-03-21 02:02:38 +01:00
parent 9ccde9cc1f
commit 557c85a79f
No known key found for this signature in database
GPG Key ID: 7E9EB2E4B0F625CD
2 changed files with 3 additions and 4 deletions

View File

@ -14,12 +14,11 @@ 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_timeout, type: String, 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'
end
post '/' do
attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list])
attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list, :maximum_timeout])
.merge(get_runner_details_from_request)
.merge(maximum_timeout_human_readable: params[:maximum_timeout])
runner =
if runner_registration_token_valid?

View File

@ -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_timeout: '2h 30m'
maximum_timeout: 9000
expect(response).to have_gitlab_http_status 201
expect(Ci::Runner.first.maximum_timeout).to eq(9000)