Commit 69b597e4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch '12852-infinite-spinner-in-deployment-board' into 'master'

Don't show deploy board if there is no deployment

See merge request gitlab-org/gitlab-ee!14699
parents d35463bf d223fed9
...@@ -46,6 +46,8 @@ module EE ...@@ -46,6 +46,8 @@ module EE
end end
def rollout_status def rollout_status
return unless has_terminals?
result = with_reactive_cache do |data| result = with_reactive_cache do |data|
deployment_platform.rollout_status(self, data) deployment_platform.rollout_status(self, data)
end end
......
...@@ -124,6 +124,14 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -124,6 +124,14 @@ describe Environment, :use_clean_rails_memory_store_caching do
subject { environment.rollout_status } subject { environment.rollout_status }
context 'environment does not have a deployment board available' do
before do
allow(environment).to receive(:has_terminals?).and_return(false)
end
it { is_expected.to be_nil }
end
context 'cached rollout status is present' do context 'cached rollout status is present' do
let(:pods) { %w(pod1 pod2) } let(:pods) { %w(pod1 pod2) }
let(:deployments) { %w(deployment1 deployment2) } let(:deployments) { %w(deployment1 deployment2) }
...@@ -141,7 +149,7 @@ describe Environment, :use_clean_rails_memory_store_caching do ...@@ -141,7 +149,7 @@ describe Environment, :use_clean_rails_memory_store_caching do
end end
end end
context 'cached rollout status is not present' do context 'cached rollout status is not present yet' do
before do before do
stub_reactive_cache(environment, nil) stub_reactive_cache(environment, nil)
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