Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-11-15 05:57:43 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2016-11-16 15:31:02 +0300
commit596bbf670c95a513cce703dce756e957a143c596 (patch)
tree73d8c34ce54c0c313a49bc91fd6bc0a6c017b29c /spec/requests
parent0934f8d5fcc7915ee99c54baacabb8f3bcb47ff3 (diff)
Send registry_url with build data to GitLab Runner
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/ci/api/builds_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb
index 6d49c42c215..bd4d3d61714 100644
--- a/spec/requests/ci/api/builds_spec.rb
+++ b/spec/requests/ci/api/builds_spec.rb
@@ -17,6 +17,10 @@ describe Ci::API::API do
let!(:build) { create(:ci_build, pipeline: pipeline, name: 'spinach', stage: 'test', stage_idx: 0) }
let(:user_agent) { 'gitlab-ci-multi-runner 1.5.2 (1-5-stable; go1.6.3; linux/amd64)' }
+ before do
+ stub_container_registry_config(enabled: false)
+ end
+
shared_examples 'no builds available' do
context 'when runner sends version in User-Agent' do
context 'for stable version' do
@@ -53,6 +57,31 @@ describe Ci::API::API do
it 'updates runner info' do
expect { register_builds }.to change { runner.reload.contacted_at }
end
+
+ context 'when registry is enabled' do
+ before do
+ stub_container_registry_config(enabled: true, host_port: 'registry.example.com:5005')
+ end
+
+ it 'sends registry_url key' do
+ register_builds info: { platform: :darwin }
+
+ expect(json_response).to have_key('registry_url')
+ expect(json_response['registry_url']).to eq("registry.example.com:5005")
+ end
+ end
+
+ context 'when registry is disabled' do
+ before do
+ stub_container_registry_config(enabled: false, host_port: 'registry.example.com:5005')
+ end
+
+ it 'does not send registry_url key' do
+ register_builds info: { platform: :darwin }
+
+ expect(json_response).not_to have_key('registry_url')
+ end
+ end
end
context 'when builds are finished' do