Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3cac5b05
Commit
3cac5b05
authored
Apr 15, 2019
by
Dylan Griffith
Committed by
Stan Hu
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix uninstall specs: helm not uninstallable
parent
024ddcab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
...ers/applications/check_uninstall_progress_service_spec.rb
+4
-4
spec/services/clusters/applications/uninstall_service_spec.rb
.../services/clusters/applications/uninstall_service_spec.rb
+5
-5
No files found.
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb
View file @
3cac5b05
...
@@ -5,7 +5,7 @@ require 'spec_helper'
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Clusters
::
Applications
::
CheckUninstallProgressService
do
describe
Clusters
::
Applications
::
CheckUninstallProgressService
do
RESCHEDULE_PHASES
=
Gitlab
::
Kubernetes
::
Pod
::
PHASES
-
[
Gitlab
::
Kubernetes
::
Pod
::
SUCCEEDED
,
Gitlab
::
Kubernetes
::
Pod
::
FAILED
].
freeze
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
(
:service
)
{
described_class
.
new
(
application
)
}
let
(
:phase
)
{
Gitlab
::
Kubernetes
::
Pod
::
UNKNOWN
}
let
(
:phase
)
{
Gitlab
::
Kubernetes
::
Pod
::
UNKNOWN
}
let
(
:errors
)
{
nil
}
let
(
:errors
)
{
nil
}
...
@@ -95,12 +95,12 @@ describe Clusters::Applications::CheckUninstallProgressService do
...
@@ -95,12 +95,12 @@ describe Clusters::Applications::CheckUninstallProgressService do
service
.
execute
service
.
execute
expect
(
application
).
to
be_uninstall_errored
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
end
end
context
'when timed out'
do
context
'when timed out'
do
let
(
:application
)
{
create
(
:clusters_applications_
helm
,
:timeouted
,
:uninstalling
)
}
let
(
:application
)
{
create
(
:clusters_applications_
prometheus
,
:timeouted
,
:uninstalling
)
}
before
do
before
do
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
expect
(
service
).
to
receive
(
:installation_phase
).
once
.
and_return
(
phase
)
...
@@ -112,7 +112,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
...
@@ -112,7 +112,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
service
.
execute
service
.
execute
expect
(
application
).
to
be_uninstall_errored
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
end
end
...
...
spec/services/clusters/applications/uninstall_service_spec.rb
View file @
3cac5b05
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
'spec_helper'
describe
Clusters
::
Applications
::
UninstallService
,
'#execute'
do
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
(
:service
)
{
described_class
.
new
(
application
)
}
let
(
:helm_client
)
{
instance_double
(
Gitlab
::
Kubernetes
::
Helm
::
Api
)
}
let
(
:helm_client
)
{
instance_double
(
Gitlab
::
Kubernetes
::
Helm
::
Api
)
}
let
(
:worker_class
)
{
Clusters
::
Applications
::
WaitForUninstallAppWorker
}
let
(
:worker_class
)
{
Clusters
::
Applications
::
WaitForUninstallAppWorker
}
...
@@ -14,7 +14,7 @@ describe Clusters::Applications::UninstallService, '#execute' do
...
@@ -14,7 +14,7 @@ describe Clusters::Applications::UninstallService, '#execute' do
context
'when there are no errors'
do
context
'when there are no errors'
do
before
do
before
do
expect
(
helm_client
).
to
receive
(
:uninstall
).
with
(
kind_of
(
Gitlab
::
Kubernetes
::
Helm
::
Reset
Command
))
expect
(
helm_client
).
to
receive
(
:uninstall
).
with
(
kind_of
(
Gitlab
::
Kubernetes
::
Helm
::
Delete
Command
))
allow
(
worker_class
).
to
receive
(
:perform_in
).
and_return
(
nil
)
allow
(
worker_class
).
to
receive
(
:perform_in
).
and_return
(
nil
)
end
end
...
@@ -36,7 +36,7 @@ describe Clusters::Applications::UninstallService, '#execute' do
...
@@ -36,7 +36,7 @@ describe Clusters::Applications::UninstallService, '#execute' do
let
(
:error
)
{
Kubeclient
::
HttpError
.
new
(
500
,
'system failure'
,
nil
)
}
let
(
:error
)
{
Kubeclient
::
HttpError
.
new
(
500
,
'system failure'
,
nil
)
}
before
do
before
do
expect
(
helm_client
).
to
receive
(
:uninstall
).
with
(
kind_of
(
Gitlab
::
Kubernetes
::
Helm
::
Reset
Command
)).
and_raise
(
error
)
expect
(
helm_client
).
to
receive
(
:uninstall
).
with
(
kind_of
(
Gitlab
::
Kubernetes
::
Helm
::
Delete
Command
)).
and_raise
(
error
)
end
end
include_examples
'logs kubernetes errors'
do
include_examples
'logs kubernetes errors'
do
...
@@ -54,11 +54,11 @@ describe Clusters::Applications::UninstallService, '#execute' do
...
@@ -54,11 +54,11 @@ describe Clusters::Applications::UninstallService, '#execute' do
end
end
context
'a non kubernetes error happens'
do
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'
)
}
let
(
:error
)
{
StandardError
.
new
(
'something bad happened'
)
}
before
do
before
do
expect
(
helm_client
).
to
receive
(
:uninstall
).
with
(
kind_of
(
Gitlab
::
Kubernetes
::
Helm
::
Reset
Command
)).
and_raise
(
error
)
expect
(
helm_client
).
to
receive
(
:uninstall
).
with
(
kind_of
(
Gitlab
::
Kubernetes
::
Helm
::
Delete
Command
)).
and_raise
(
error
)
end
end
include_examples
'logs kubernetes errors'
do
include_examples
'logs kubernetes errors'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment