diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-07 11:16:57 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-07 11:16:57 +0300 |
commit | 86d8531748208efdbc430c552bbb89567c86378d (patch) | |
tree | b6a7616ffe8d7e0fbab3ff75f0cab708925c5a41 /spec/services/clusters | |
parent | a46d32412ec93be2d6d10bd4bcbdd23b69d31865 (diff) |
Remove Clusters::Applications::FinalizeInstallationService
Diffstat (limited to 'spec/services/clusters')
-rw-r--r-- | spec/services/clusters/applications/check_installation_progress_service_spec.rb | 17 | ||||
-rw-r--r-- | spec/services/clusters/applications/finalize_installation_service_spec.rb | 32 |
2 files changed, 13 insertions, 36 deletions
diff --git a/spec/services/clusters/applications/check_installation_progress_service_spec.rb b/spec/services/clusters/applications/check_installation_progress_service_spec.rb index fe04fac9613..faa5b469069 100644 --- a/spec/services/clusters/applications/check_installation_progress_service_spec.rb +++ b/spec/services/clusters/applications/check_installation_progress_service_spec.rb @@ -9,8 +9,8 @@ describe Clusters::Applications::CheckInstallationProgressService do let(:errors) { nil } shared_examples 'a terminated installation' do - it 'finalize the installation' do - expect(service).to receive(:finalize_installation).once + it 'removes the installation POD' do + expect(service).to receive(:remove_installation_pod).once service.execute end @@ -23,7 +23,7 @@ describe Clusters::Applications::CheckInstallationProgressService do context 'when not timeouted' do it 'reschedule a new check' do expect(ClusterWaitForAppInstallationWorker).to receive(:perform_in).once - expect(service).not_to receive(:finalize_installation) + expect(service).not_to receive(:remove_installation_pod) service.execute @@ -53,7 +53,7 @@ describe Clusters::Applications::CheckInstallationProgressService do expect(service).to receive(:installation_phase).once.and_return(phase) allow(service).to receive(:installation_errors).and_return(errors) - allow(service).to receive(:finalize_installation).and_return(nil) + allow(service).to receive(:remove_installation_pod).and_return(nil) end describe '#execute' do @@ -61,6 +61,15 @@ describe Clusters::Applications::CheckInstallationProgressService do let(:phase) { Gitlab::Kubernetes::Pod::SUCCEEDED } it_behaves_like 'a terminated installation' + + it 'make the application installed' do + expect(ClusterWaitForAppInstallationWorker).not_to receive(:perform_in) + + service.execute + + expect(application).to be_installed + expect(application.status_reason).to be_nil + end end context 'when installation POD failed' do diff --git a/spec/services/clusters/applications/finalize_installation_service_spec.rb b/spec/services/clusters/applications/finalize_installation_service_spec.rb deleted file mode 100644 index 08b7a80dfcd..00000000000 --- a/spec/services/clusters/applications/finalize_installation_service_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -require 'spec_helper' - -describe Clusters::Applications::FinalizeInstallationService do - describe '#execute' do - let(:application) { create(:applications_helm, :installing) } - let(:service) { described_class.new(application) } - - before do - expect_any_instance_of(Gitlab::Kubernetes::Helm).to receive(:delete_installation_pod!).with(application) - end - - context 'when installation POD succeeded' do - it 'make the application installed' do - service.execute - - expect(application).to be_installed - expect(application.status_reason).to be_nil - end - end - - context 'when installation POD failed' do - let(:application) { create(:applications_helm, :errored) } - - it 'make the application errored' do - service.execute - - expect(application).to be_errored - expect(application.status_reason).not_to be_nil - end - end - end -end |