forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_deletion_test.go
41 lines (38 loc) · 1.03 KB
/
app_deletion_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package e2e
import (
"testing"
. "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
. "github.com/argoproj/argo-cd/test/e2e/fixture"
. "github.com/argoproj/argo-cd/test/e2e/fixture/app"
)
// when a app gets stuck in sync, and we try to delete it, it won't delete, instead we must then terminate it
// and deletion will then just happen
func TestDeletingAppStuckInSync(t *testing.T) {
Given(t).
And(func() {
SetResourceOverrides(map[string]ResourceOverride{
"ConfigMap": {
HealthLua: `return { status = obj.annotations and obj.annotations['health'] or 'Progressing' }`,
},
})
}).
Async(true).
Path("hook-custom-health").
When().
Create().
Sync().
Then().
// stuck in running state
Expect(OperationPhaseIs(OperationRunning)).
Expect(SyncStatusIs(SyncStatusCodeOutOfSync)).
When().
Delete(true).
Then().
// delete is ignored, still stuck in running state
Expect(OperationPhaseIs(OperationRunning)).
When().
TerminateOp().
Then().
// delete is successful
Expect(DoesNotExist())
}