Merge branch 'add-failure-reason-for-execution-timeout' into 'master'

Add failure reason for execution timeout

See merge request gitlab-org/gitlab-ce!22224
This commit is contained in:
Kamil Trzciński 2018-10-28 18:31:08 +00:00
commit 04184b32ec
5 changed files with 20 additions and 3 deletions

View file

@ -50,7 +50,8 @@ class CommitStatus < ActiveRecord::Base
runner_system_failure: 4,
missing_dependency_failure: 5,
runner_unsupported: 6,
stale_schedule: 7
stale_schedule: 7,
job_execution_timeout: 8
}
##

View file

@ -9,7 +9,8 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
runner_system_failure: 'There has been a runner system failure, please try again',
missing_dependency_failure: 'There has been a missing dependency failure',
runner_unsupported: 'Your runner is outdated, please upgrade your runner',
stale_schedule: 'Delayed job could not be executed by some reason, please try again'
stale_schedule: 'Delayed job could not be executed by some reason, please try again',
job_execution_timeout: 'The script exceeded the maximum execution time set for the job'
}.freeze
private_constant :CALLOUT_FAILURE_MESSAGES

View file

@ -0,0 +1,5 @@
---
title: Add failure reason for execution timeout
merge_request: 22224
author:
type: changed

View file

@ -11,7 +11,8 @@ module Gitlab
runner_system_failure: 'runner system failure',
missing_dependency_failure: 'missing dependency failure',
runner_unsupported: 'unsupported runner',
stale_schedule: 'stale schedule'
stale_schedule: 'stale schedule',
job_execution_timeout: 'job execution timeout'
}.freeze
private_constant :REASONS

View file

@ -806,6 +806,15 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
it { expect(job).to be_unknown_failure }
end
context 'when failure_reason is job_execution_timeout' do
before do
update_job(state: 'failed', failure_reason: 'job_execution_timeout')
job.reload
end
it { expect(job).to be_job_execution_timeout }
end
end
context 'when trace is given' do