diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-08 12:07:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-08 12:07:53 +0300 |
commit | a821bd6ad17e304ca93838a411410a44ee9cff9f (patch) | |
tree | 5444ab20a2f8b22db736a93c5c376928dde8e450 /spec/services/prometheus | |
parent | f6e985dba4d0f5b1ede95e9174d30dd6a8bedf0d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/prometheus')
-rw-r--r-- | spec/services/prometheus/adapter_service_spec.rb | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/spec/services/prometheus/adapter_service_spec.rb b/spec/services/prometheus/adapter_service_spec.rb deleted file mode 100644 index 3c075fc1581..00000000000 --- a/spec/services/prometheus/adapter_service_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe Prometheus::AdapterService do - let_it_be(:project) { create(:project) } - let_it_be(:cluster, reload: true) { create(:cluster, :provided_by_user, environment_scope: '*', projects: [project]) } - - subject { described_class.new(project, cluster) } - - describe '#prometheus_adapter' do - context 'prometheus service can execute queries' do - let(:prometheus_service) { double(:prometheus_service, can_query?: true) } - - before do - allow(project).to receive(:find_or_initialize_service).with('prometheus').and_return prometheus_service - end - - it 'return prometheus service as prometheus adapter' do - expect(subject.prometheus_adapter).to eq(prometheus_service) - end - end - - context "prometheus service can't execute queries" do - let(:prometheus_service) { double(:prometheus_service, can_query?: false) } - - context 'with cluster with prometheus not available' do - let!(:prometheus) { create(:clusters_applications_prometheus, :installable, cluster: cluster) } - - it 'returns nil' do - expect(subject.prometheus_adapter).to be_nil - end - end - - context 'with cluster with prometheus available' do - let!(:prometheus) { create(:clusters_applications_prometheus, :installed, cluster: cluster) } - - it 'returns application handling all environments' do - expect(subject.prometheus_adapter).to eq(prometheus) - end - end - - context 'with cluster without prometheus installed' do - it 'returns nil' do - expect(subject.prometheus_adapter).to be_nil - end - end - end - end -end |