Skip to content

Commit

Permalink
Add b/g e2e test on scaledownOnAbort
Browse files Browse the repository at this point in the history
Signed-off-by: Hui Kang <[email protected]>
  • Loading branch information
Hui Kang committed May 24, 2021
1 parent b33ed06 commit 95e0b6c
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,57 @@ spec:
ExpectReplicaCounts(1, 2, 1, 1, 1)
}

// TestBlueGreenScaleDownOnAbort verifies the scaleDownOnAbort feature
func (s *FunctionalSuite) TestBlueGreenScaleDownOnAbort() {
s.Given().
RolloutObjects(newService("bluegreen-preview-replicas-active")).
RolloutObjects(newService("bluegreen-preview-replicas-preview")).
RolloutObjects(`
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: bluegreen-scaledown-on-abort
spec:
replicas: 2
scaleDownOnAbort: true
strategy:
blueGreen:
activeService: bluegreen-preview-replicas-active
previewService: bluegreen-preview-replicas-preview
previewReplicaCount: 1
scaleDownDelaySeconds: 5
autoPromotionEnabled: false
selector:
matchLabels:
app: bluegreen-preview-replicas
template:
metadata:
labels:
app: bluegreen-preview-replicas
spec:
containers:
- name: bluegreen-preview-replicas
image: nginx:1.19-alpine
resources:
requests:
memory: 16Mi
cpu: 1m
`).
When().
ApplyManifests().
WaitForRolloutStatus("Healthy").
UpdateSpec().
WaitForRolloutStatus("Paused").
Then().
ExpectRevisionPodCount("2", 1).
ExpectRevisionPodCount("1", 2).
When().
AbortRollout().
WaitForRolloutStatus("Degraded").
Then().
ExpectRevisionPodCount("2", 0)
}

func (s *FunctionalSuite) TestKubectlWaitForPaused() {
s.Given().
HealthyRollout(`
Expand Down

0 comments on commit 95e0b6c

Please sign in to comment.