diff options
author | Reuben Pereira <rpereira@gitlab.com> | 2019-09-02 17:35:02 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-09-02 17:35:02 +0300 |
commit | 414523b0bf7fc5728d8d118b2823be8610546fe6 (patch) | |
tree | d3b8612b2ac57f9b2ccf5d6aca45719e55c79472 /spec/lib | |
parent | 2d3dc05fb948c27d0eab1ca2600f0adcf7dc3144 (diff) |
Handle :9090 and 0.0.0.0:9090 listen_address formats
Prometheus listen_address can be in formats of :9090 and 0.0.0.0:9090.
But before these can be used to connect a project to Prometheus, they
have to converted into absolute URIs.
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb index b3dedfe1f77..aab6fbcbbd1 100644 --- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb +++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb @@ -176,14 +176,28 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do end context 'with non default prometheus address' do + let(:listen_address) { 'https://localhost:9090' } + let(:prometheus_settings) do { enable: true, - listen_address: 'https://localhost:9090' + listen_address: listen_address } end it_behaves_like 'has prometheus service', 'https://localhost:9090' + + context 'with :9090 symbol' do + let(:listen_address) { :':9090' } + + it_behaves_like 'has prometheus service', 'http://localhost:9090' + end + + context 'with 0.0.0.0:9090' do + let(:listen_address) { '0.0.0.0:9090' } + + it_behaves_like 'has prometheus service', 'http://localhost:9090' + end end context 'when prometheus setting is not present in gitlab.yml' do |