Commit a3ec8457 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Fix backported CE code

parent afa418e5
......@@ -241,9 +241,9 @@ class Environment < ActiveRecord::Base
end
def cluster_prometheus_adapter
return unless project.deployment_platform.respond_to?(:cluster)
return unless deployment_platform.respond_to?(:cluster)
cluster = project.deployment_platform.cluster
cluster = deployment_platform.cluster
return unless cluster.application_prometheus&.installed?
cluster.application_prometheus
......
......@@ -493,8 +493,8 @@ describe Environment do
end
it 'returns the metrics from the deployment service' do
expect(project.monitoring_service)
.to receive(:environment_metrics).with(environment)
expect(environment.prometheus_adapter)
.to receive(:query).with(:environment, environment)
.and_return(:fake_metrics)
is_expected.to eq(:fake_metrics)
......
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