diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-01 10:52:11 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-05 08:30:28 +0300 |
commit | 68f6c61cf621db82ac98d561782590b1866fcf6f (patch) | |
tree | 8d87711be50a9966939fe81aef158b8dfdb67fee /spec/requests | |
parent | 1d7c0390722c96aa66af5b26f5a826b97293dcd6 (diff) |
- Allow runner API to pass failure_reason
- Fix spec
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/commit_statuses_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/spec/requests/api/commit_statuses_spec.rb b/spec/requests/api/commit_statuses_spec.rb index e4c73583545..ed1962ede42 100644 --- a/spec/requests/api/commit_statuses_spec.rb +++ b/spec/requests/api/commit_statuses_spec.rb @@ -143,7 +143,7 @@ describe API::CommitStatuses do expect(json_response['target_url']).to be_nil expect(json_response['description']).to be_nil if status == 'failed' - expect(CommitStatus.find(json_response['id'])).to be_api_failure + expect(json_response['failure_reason']).to eq('api_failure') end end end diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 386e76c6300..f9dcd9d07cb 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -636,6 +636,15 @@ describe API::Runner do expect(job.reload.status).to eq 'failed' expect(job).to be_job_failure end + + context 'when failure_reason is given' do + it 'mark job as failed' do + update_job(state: 'failed', failure_reason: 'stuck_or_timeout_failure') + + expect(job.reload.status).to eq 'failed' + expect(job).to be_stuck_or_timeout_failure + end + end end context 'when tace is given' do |