Expose GitLab features to the CI runner

This commit is contained in:
Alessio Caiazza 2017-09-27 16:01:33 +02:00
parent 5709408585
commit 79e1f33f13
3 changed files with 8 additions and 0 deletions

View File

@ -229,6 +229,10 @@ module Ci
variables
end
def features
{ trace_sections: true }
end
def merge_request
return @merge_request if defined?(@merge_request)

View File

@ -1020,6 +1020,7 @@ module API
expose :cache, using: Cache
expose :credentials, using: Credentials
expose :dependencies, using: Dependency
expose :features
end
end

View File

@ -360,6 +360,8 @@ describe API::Runner do
'policy' => 'pull-push' }]
end
let(:expected_features) { { 'trace_sections' => true } }
it 'picks a job' do
request_job info: { platform: :darwin }
@ -379,6 +381,7 @@ describe API::Runner 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)
end
context 'when job is made for tag' do