diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-14 10:57:47 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-14 10:57:47 +0300 |
commit | b29bf62602b6e962ceb31dd7535743a7d8c4864c (patch) | |
tree | cc51ea56cd8db0925edc765e22dd7fc103c44f7d /spec/requests | |
parent | da66c90b0f154452d7fe7ea9a6d296466cb7f223 (diff) | |
parent | 645c8651410961e61cf220e859f2faddaf66b5e7 (diff) |
Merge branch 'feature/add-support-for-services-configuration' into 'master'
Add support for services configuration in .gitlab-ci.yml
See merge request !8578
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/runner_spec.rb | 7 | ||||
-rw-r--r-- | spec/requests/ci/api/builds_spec.rb | 12 |
2 files changed, 17 insertions, 2 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 9556c99dea1..5a4f0513248 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -356,8 +356,11 @@ describe API::Runner do expect(json_response['token']).to eq(job.token) expect(json_response['job_info']).to eq(expected_job_info) expect(json_response['git_info']).to eq(expected_git_info) - expect(json_response['image']).to eq({ 'name' => 'ruby:2.1' }) - expect(json_response['services']).to eq([{ 'name' => 'postgres' }]) + expect(json_response['image']).to eq({ 'name' => 'ruby:2.1', 'entrypoint' => '/bin/sh' }) + expect(json_response['services']).to eq([{ 'name' => 'postgres', 'entrypoint' => nil, + 'alias' => nil, 'command' => nil }, + { 'name' => 'docker:dind', 'entrypoint' => '/bin/sh', + 'alias' => 'docker', 'command' => 'sleep 30' }]) expect(json_response['steps']).to eq(expected_steps) expect(json_response['artifacts']).to eq(expected_artifacts) expect(json_response['cache']).to eq(expected_cache) diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index 286de277ae7..04cc7708858 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -137,6 +137,18 @@ describe Ci::API::Builds do end end end + + context 'when docker configuration options are used' do + let!(:build) { create(:ci_build, :extended_options, pipeline: pipeline, name: 'spinach', stage: 'test', stage_idx: 0) } + + it 'starts a build' do + register_builds info: { platform: :darwin } + + expect(response).to have_http_status(201) + expect(json_response['options']['image']).to eq('ruby:2.1') + expect(json_response['options']['services']).to eq(['postgres', 'docker:dind']) + end + end end context 'when builds are finished' do |