Add validation for max_timeout in Ci::Runner
This commit is contained in:
parent
c747d9bc0b
commit
7d7b0688b8
2 changed files with 5 additions and 1 deletions
|
@ -54,6 +54,10 @@ module Ci
|
|||
|
||||
chronic_duration_attr :maximum_timeout_human_readable, :maximum_timeout
|
||||
|
||||
validates :maximum_timeout, allow_nil: true,
|
||||
numericality: { greater_than_or_equal_to: 600,
|
||||
message: 'needs to be at least 10 minutes' }
|
||||
|
||||
# Searches for runners matching the given query.
|
||||
#
|
||||
# This method uses ILIKE on PostgreSQL and LIKE on MySQL.
|
||||
|
|
|
@ -1299,7 +1299,7 @@ describe Ci::Build do
|
|||
end
|
||||
|
||||
context 'when runner sets timeout to smaller value' do
|
||||
let(:runner2) { create(:ci_runner, maximum_timeout: 500) }
|
||||
let(:runner2) { create(:ci_runner, maximum_timeout: 600) }
|
||||
let(:build) { create(:ci_build, :pending, pipeline: pipeline2, runner: runner2) }
|
||||
|
||||
it 'returns project timeout configuration' do
|
||||
|
|
Loading…
Reference in a new issue