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:
authorThong Kuah <tkuah@gitlab.com>2019-07-04 08:26:37 +0300
committerThong Kuah <tkuah@gitlab.com>2019-07-08 00:14:37 +0300
commitc85d6b0c744e9a971fafdf58328f907dfa0de127 (patch)
tree5d65b622c5bc40ec0cc0deb66be33edb660383a7 /spec/models/deployment_metrics_spec.rb
parent25ba11a2aad9571e4759cdc711199634e3392c5b (diff)
Restore fallback to deployment_platform_cluster
In 12.2 we will remove this fallback.
Diffstat (limited to 'spec/models/deployment_metrics_spec.rb')
-rw-r--r--spec/models/deployment_metrics_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/deployment_metrics_spec.rb b/spec/models/deployment_metrics_spec.rb
index 7c574a8b6c8..0aadb1f3a5e 100644
--- a/spec/models/deployment_metrics_spec.rb
+++ b/spec/models/deployment_metrics_spec.rb
@@ -49,6 +49,18 @@ describe DeploymentMetrics do
it { is_expected.to be_truthy }
end
+
+ context 'fallback deployment platform' do
+ let(:cluster) { create(:cluster, :provided_by_user, environment_scope: '*', projects: [deployment.project]) }
+ let!(:prometheus) { create(:clusters_applications_prometheus, :installed, cluster: cluster) }
+
+ before do
+ expect(deployment.project).to receive(:deployment_platform).and_return(cluster.platform)
+ expect(cluster.application_prometheus).to receive(:can_query?).and_return(true)
+ end
+
+ it { is_expected.to be_truthy }
+ end
end
end