Commit aae06755 authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'spec_registry_port' into 'master'

Add test for configuration option to change registry's internal port

Related to issue #1433 .

Added two tests for checking whether config files are generated correctly when registry's internal port is explicitly set using configuration option `registry['registry_http_addr']` - one for registry's conf file and one for gitlab-rails's.

See merge request !1027
parents 4a8f5fd0 c16cce06
......@@ -74,6 +74,8 @@ describe 'registry recipe' do
.with_content(/version: 0.1/)
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(/realm: \/jwt\/auth/)
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(/addr: localhost:5000/)
end
it 'creates a default VERSION file' do
......@@ -82,5 +84,20 @@ describe 'registry recipe' do
group: nil
)
end
it 'creates gitlab-rails config with default values' do
expect(chef_run).to render_file('/var/opt/gitlab/gitlab-rails/etc/gitlab.yml')
.with_content(/api_url: http:\/\/localhost:5000/)
end
end
context 'when registry port is specified' do
before { stub_gitlab_rb(registry_external_url: 'https://registry.example.com', registry: { registry_http_addr: 'localhost:5001' }) }
it 'creates registry and rails configs with specified value' do
expect(chef_run).to render_file('/var/opt/gitlab/registry/config.yml')
.with_content(/addr: localhost:5001/)
expect(chef_run).to render_file('/var/opt/gitlab/gitlab-rails/etc/gitlab.yml')
.with_content(/api_url: http:\/\/localhost:5001/)
end
end
end
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