summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-02-19 17:21:00 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2018-03-28 13:55:46 +0200
commit7b82f4bab1661d7f7e7cb044730c977329275240 (patch)
tree9ef9ed1c20b2e1391e2f5446ae9800446528f557 /spec
parentfb0dec4e00f1efd637692982ba031f479103cc35 (diff)
downloadgitlab-ce-7b82f4bab1661d7f7e7cb044730c977329275240.tar.gz
Add support for job_upper_timeout in API
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/runner_spec.rb10
-rw-r--r--spec/requests/api/runners_spec.rb5
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index f3dd121faa9..8c8f4bb7018 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -109,6 +109,16 @@ describe API::Runner do
end
end
+ context 'when job upper timeout is specified' do
+ it 'creates runner' do
+ post api('/runners'), token: registration_token,
+ job_upper_timeout: 7200
+
+ expect(response).to have_gitlab_http_status 201
+ expect(Ci::Runner.first.job_upper_timeout).to eq(7200)
+ end
+ end
+
%w(name version revision platform architecture).each do |param|
context "when info parameter '#{param}' info is present" do
let(:value) { "#{param}_value" }
diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb
index ec5cad4f4fd..0444880a300 100644
--- a/spec/requests/api/runners_spec.rb
+++ b/spec/requests/api/runners_spec.rb
@@ -123,6 +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
end
end
@@ -192,7 +193,8 @@ describe API::Runners do
tag_list: ['ruby2.1', 'pgsql', 'mysql'],
run_untagged: 'false',
locked: 'true',
- access_level: 'ref_protected')
+ access_level: 'ref_protected',
+ job_upper_timeout: 1234 )
shared_runner.reload
expect(response).to have_gitlab_http_status(200)
@@ -204,6 +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)
end
end