diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-02-21 01:21:59 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 13:55:46 +0200 |
commit | d633bc8134fe472137fb668c1eb78de45dc9bb57 (patch) | |
tree | d50c6d3a4bceb0bda5a20b05820bf9efb37b5b40 /spec | |
parent | a4ea9a93db98461479dcb8e1d7b8425a77018f1e (diff) | |
download | gitlab-ce-d633bc8134fe472137fb668c1eb78de45dc9bb57.tar.gz |
Rename job_upper_timeout to maximum_job_timeout
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/build_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/ci/runner_spec.rb | 12 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb | 10 | ||||
-rw-r--r-- | spec/requests/api/runners_spec.rb | 6 |
4 files changed, 17 insertions, 17 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index d13421a107f..115106548f0 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1281,7 +1281,7 @@ describe Ci::Build do end context 'when runner sets timeout to bigger value' do - let(:runner2) { create(:ci_runner, job_upper_timeout: 2000) } + let(:runner2) { create(:ci_runner, maximum_job_timeout: 2000) } let(:build) { create(:ci_build, :manual, pipeline: pipeline2, runner: runner2) } it 'returns project timeout configuration' do @@ -1290,11 +1290,11 @@ describe Ci::Build do end context 'when runner sets timeout to smaller value' do - let(:runner2) { create(:ci_runner, job_upper_timeout: 500) } + let(:runner2) { create(:ci_runner, maximum_job_timeout: 500) } let(:build) { create(:ci_build, :manual, pipeline: pipeline2, runner: runner2) } it 'returns project timeout configuration' do - expect(build.timeout).to eq(runner2.job_upper_timeout) + expect(build.timeout).to eq(runner2.maximum_job_timeout) end end end diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 80d7cd92fdb..5b5fa7fac01 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -556,20 +556,20 @@ describe Ci::Runner do end end - describe '#defines_job_upper_timeout?' do - context 'when job upper timeout is specified' do - subject { create(:ci_runner, job_upper_timeout: 1234) } + describe '#defines_maximum_job_timeout?' do + context 'when maximum job timeout is specified' do + subject { create(:ci_runner, maximum_job_timeout: 1234) } it 'should return true' do - expect(subject.defines_job_upper_timeout?).to be_truthy + expect(subject.defines_maximum_job_timeout?).to be_truthy end end - context 'when job upper timeout is not specified' do + context 'when maximum job timeout is not specified' do subject { create(:ci_runner) } it 'should return false' do - expect(subject.defines_job_upper_timeout?).to be_falsey + expect(subject.defines_maximum_job_timeout?).to be_falsey end end end diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 3eb0e88d095..a6a4f510406 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -109,13 +109,13 @@ describe API::Runner do end end - context 'when job upper timeout is specified' do + context 'when maximum job timeout is specified' do it 'creates runner' do post api('/runners'), token: registration_token, - job_upper_timeout: 7200 + maximum_job_timeout: 7200 expect(response).to have_gitlab_http_status 201 - expect(Ci::Runner.first.job_upper_timeout).to eq(7200) + expect(Ci::Runner.first.maximum_job_timeout).to eq(7200) end end @@ -671,7 +671,7 @@ describe API::Runner do end context 'when runner specifies lower timeout' do - let(:runner) { create(:ci_runner, job_upper_timeout: 1000) } + let(:runner) { create(:ci_runner, maximum_job_timeout: 1000) } it 'contains info about timeout overridden by runner' do request_job @@ -682,7 +682,7 @@ describe API::Runner do end context 'when runner specifies bigger timeout' do - let(:runner) { create(:ci_runner, job_upper_timeout: 2000) } + let(:runner) { create(:ci_runner, maximum_job_timeout: 2000) } it 'contains info about timeout not overridden by runner' do request_job diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb index 0444880a300..836b22f5657 100644 --- a/spec/requests/api/runners_spec.rb +++ b/spec/requests/api/runners_spec.rb @@ -123,7 +123,7 @@ describe API::Runners do expect(response).to have_gitlab_http_status(200) expect(json_response['description']).to eq(shared_runner.description) - expect(json_response['job_upper_timeout']).to be_nil + expect(json_response['maximum_job_timeout']).to be_nil end end @@ -194,7 +194,7 @@ describe API::Runners do run_untagged: 'false', locked: 'true', access_level: 'ref_protected', - job_upper_timeout: 1234 ) + maximum_job_timeout: 1234 ) shared_runner.reload expect(response).to have_gitlab_http_status(200) @@ -206,7 +206,7 @@ describe API::Runners do expect(shared_runner.ref_protected?).to be_truthy expect(shared_runner.ensure_runner_queue_value) .not_to eq(runner_queue_value) - expect(shared_runner.job_upper_timeout).to eq(1234) + expect(shared_runner.maximum_job_timeout).to eq(1234) end end |