Commit b8e691c5 authored by James Fargher's avatar James Fargher

Merge branch 'expose-failure-reasons-features' into 'master'

Expose `failure_reasons` in `Build#features`

See merge request gitlab-org/gitlab!53964
parents 098083e7 1396acae
......@@ -564,7 +564,10 @@ module Ci
end
def features
{ trace_sections: true }
{
trace_sections: true,
failure_reasons: self.class.failure_reasons.keys
}
end
def merge_request
......
---
title: Expose `failure_reasons` in `Build#features`
merge_request: 53964
author:
type: added
......@@ -198,7 +198,12 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
'when' => 'on_success' }]
end
let(:expected_features) { { 'trace_sections' => true } }
let(:expected_features) do
{
'trace_sections' => true,
'failure_reasons' => include('script_failure')
}
end
it 'picks a job' do
request_job info: { platform: :darwin }
......@@ -220,7 +225,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
expect(json_response['artifacts']).to eq(expected_artifacts)
expect(json_response['cache']).to eq(expected_cache)
expect(json_response['variables']).to include(*expected_variables)
expect(json_response['features']).to eq(expected_features)
expect(json_response['features']).to match(expected_features)
end
it 'creates persistent ref' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment