summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2019-04-15 16:42:43 +1000
committerDylan Griffith <dyl.griffith@gmail.com>2019-04-18 15:05:37 +1000
commit9bc3408bd084c860b2db0a2a1d0457d9c90d87d1 (patch)
tree1b364b0cfda815601005b724990ca188b8cb02f9
parent55ded4d90bafa016ff7ada75c4f69f9c9c23f0af (diff)
downloadgitlab-ce-uninstall_cluster_apps.tar.gz
Fix uninstall specs: helm not uninstallableuninstall_cluster_apps
-rw-r--r--spec/services/clusters/applications/check_uninstall_progress_service_spec.rb8
-rw-r--r--spec/services/clusters/applications/uninstall_service_spec.rb10
2 files changed, 9 insertions, 9 deletions
diff --git a/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb b/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
index 084f29d9d2d..fedca51a1b4 100644
--- a/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
+++ b/spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe Clusters::Applications::CheckUninstallProgressService do
RESCHEDULE_PHASES = Gitlab::Kubernetes::Pod::PHASES - [Gitlab::Kubernetes::Pod::SUCCEEDED, Gitlab::Kubernetes::Pod::FAILED].freeze
- let(:application) { create(:clusters_applications_helm, :uninstalling) }
+ let(:application) { create(:clusters_applications_prometheus, :uninstalling) }
let(:service) { described_class.new(application) }
let(:phase) { Gitlab::Kubernetes::Pod::UNKNOWN }
let(:errors) { nil }
@@ -95,12 +95,12 @@ describe Clusters::Applications::CheckUninstallProgressService do
service.execute
expect(application).to be_uninstall_errored
- expect(application.status_reason).to eq('Operation failed. Check pod logs for uninstall-helm for more details.')
+ expect(application.status_reason).to eq('Operation failed. Check pod logs for uninstall-prometheus for more details.')
end
end
context 'when timed out' do
- let(:application) { create(:clusters_applications_helm, :timeouted, :uninstalling) }
+ let(:application) { create(:clusters_applications_prometheus, :timeouted, :uninstalling) }
before do
expect(service).to receive(:installation_phase).once.and_return(phase)
@@ -112,7 +112,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
service.execute
expect(application).to be_uninstall_errored
- expect(application.status_reason).to eq('Operation timed out. Check pod logs for uninstall-helm for more details.')
+ expect(application.status_reason).to eq('Operation timed out. Check pod logs for uninstall-prometheus for more details.')
end
end
diff --git a/spec/services/clusters/applications/uninstall_service_spec.rb b/spec/services/clusters/applications/uninstall_service_spec.rb
index d1d0e923e18..16497d752b2 100644
--- a/spec/services/clusters/applications/uninstall_service_spec.rb
+++ b/spec/services/clusters/applications/uninstall_service_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
describe Clusters::Applications::UninstallService, '#execute' do
- let(:application) { create(:clusters_applications_helm, :scheduled) }
+ let(:application) { create(:clusters_applications_prometheus, :scheduled) }
let(:service) { described_class.new(application) }
let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::Api) }
let(:worker_class) { Clusters::Applications::WaitForUninstallAppWorker }
@@ -14,7 +14,7 @@ describe Clusters::Applications::UninstallService, '#execute' do
context 'when there are no errors' do
before do
- expect(helm_client).to receive(:uninstall).with(kind_of(Gitlab::Kubernetes::Helm::ResetCommand))
+ expect(helm_client).to receive(:uninstall).with(kind_of(Gitlab::Kubernetes::Helm::DeleteCommand))
allow(worker_class).to receive(:perform_in).and_return(nil)
end
@@ -36,7 +36,7 @@ describe Clusters::Applications::UninstallService, '#execute' do
let(:error) { Kubeclient::HttpError.new(500, 'system failure', nil) }
before do
- expect(helm_client).to receive(:uninstall).with(kind_of(Gitlab::Kubernetes::Helm::ResetCommand)).and_raise(error)
+ expect(helm_client).to receive(:uninstall).with(kind_of(Gitlab::Kubernetes::Helm::DeleteCommand)).and_raise(error)
end
include_examples 'logs kubernetes errors' do
@@ -54,11 +54,11 @@ describe Clusters::Applications::UninstallService, '#execute' do
end
context 'a non kubernetes error happens' do
- let(:application) { create(:clusters_applications_helm, :scheduled) }
+ let(:application) { create(:clusters_applications_prometheus, :scheduled) }
let(:error) { StandardError.new('something bad happened') }
before do
- expect(helm_client).to receive(:uninstall).with(kind_of(Gitlab::Kubernetes::Helm::ResetCommand)).and_raise(error)
+ expect(helm_client).to receive(:uninstall).with(kind_of(Gitlab::Kubernetes::Helm::DeleteCommand)).and_raise(error)
end
include_examples 'logs kubernetes errors' do