Commit 3e965e07 authored by Sean McGivern's avatar Sean McGivern

Merge branch '212346-set-environment-available-flag' into 'master'

Add environment-state flag to metrics data

Closes #212346

See merge request gitlab-org/gitlab!28237
parents 00540b97 b83c2e28
......@@ -38,7 +38,8 @@ module EnvironmentsHelper
"tags-path" => project_tags_path(project),
"has-metrics" => "#{environment.has_metrics?}",
"prometheus-status" => "#{environment.prometheus_status}",
"external-dashboard-url" => project.metrics_setting_external_dashboard_url
"external-dashboard-url" => project.metrics_setting_external_dashboard_url,
"environment-state" => "#{environment.state}"
}
end
......
---
title: Add environment-state flag to metrics data
merge_request: 28237
author:
type: added
......@@ -33,7 +33,8 @@ describe EnvironmentsHelper do
'tags-path' => project_tags_path(project),
'has-metrics' => "#{environment.has_metrics?}",
'prometheus-status' => "#{environment.prometheus_status}",
'external-dashboard-url' => nil
'external-dashboard-url' => nil,
'environment-state' => environment.state
)
end
......@@ -46,5 +47,15 @@ describe EnvironmentsHelper do
expect(metrics_data['external-dashboard-url']).to eq('http://gitlab.com')
end
end
context 'when the environment is not available' do
before do
environment.stop
end
subject { metrics_data }
it { is_expected.to include('environment-state' => 'stopped') }
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