Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
e2e: use podinfo's --unready to make release fail
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco committed Jan 29, 2020
1 parent 0d59ced commit d3b2a21
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions test/e2e/20_rollbacks.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function setup() {
poll_until_equals 'podinfo-helm-repository HelmRelease' 'deployed' "kubectl -n $DEMO_NAMESPACE get helmrelease/podinfo-helm-repository -o 'custom-columns=status:status.releaseStatus' --no-headers"

# Apply a faulty patch
kubectl patch -f "$FIXTURES_DIR/releases/helm-repository.yaml" --type='json' -p='[{"op": "replace", "path": "/spec/values/service/type", "value":"LoadBalancer"}]' >&3
kubectl patch -f "$FIXTURES_DIR/releases/helm-repository.yaml" --type='json' -p='[{"op": "replace", "path": "/spec/values/faults/unready", "value":"true"}]' >&3

# Wait for release failure
poll_until_equals 'podinfo-helm-repository HelmRelease upgrade failure' 'HelmUpgradeFailed' "kubectl -n $DEMO_NAMESPACE get helmrelease/podinfo-helm-repository -o jsonpath='{.status.conditions[?(@.type==\"Released\")].reason}'"
Expand All @@ -44,7 +44,7 @@ function setup() {
poll_until_equals 'podinfo-git HelmRelease' 'deployed' "kubectl -n $DEMO_NAMESPACE get helmrelease/podinfo-git -o 'custom-columns=status:status.releaseStatus' --no-headers"

# Apply a faulty patch
kubectl patch -f "$FIXTURES_DIR/releases/git.yaml" --type='json' -p='[{"op": "replace", "path": "/spec/values/service/type", "value":"LoadBalancer"}]' >&3
kubectl patch -f "$FIXTURES_DIR/releases/git.yaml" --type='json' -p='[{"op": "replace", "path": "/spec/values/faults/unready", "value":"true"}]' >&3

# Wait for release failure
poll_until_equals 'podinfo-git HelmRelease upgrade failure' 'HelmUpgradeFailed' "kubectl -n $DEMO_NAMESPACE get helmrelease/podinfo-git -o jsonpath='{.status.conditions[?(@.type==\"Released\")].reason}'"
Expand Down
13 changes: 6 additions & 7 deletions test/e2e/fixtures/releases/git.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ metadata:
spec:
releaseName: podinfo-git
timeout: 10
resetValues: false
forceUpgrade: false
wait: true
rollback:
enable: true
wait: true
chart:
git: ssh://git@gitsrv/git-server/repos/cluster.git
ref: master
path: charts/podinfo
values:
replicaCount: 1
replicaCount: 2

service:
enabled: true
type: NodePort
nodePort: 31198
faults:
# Setting this to 'true' will make the release fail
unready: false
13 changes: 6 additions & 7 deletions test/e2e/fixtures/releases/helm-repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ metadata:
spec:
releaseName: podinfo-helm-repository
timeout: 10
resetValues: false
forceUpgrade: false
wait: true
rollback:
enable: true
wait: true
chart:
repository: https://stefanprodan.github.io/podinfo
name: podinfo
version: 3.2.0
values:
replicaCount: 1
replicaCount: 2

service:
enabled: true
type: NodePort
nodePort: 31199
faults:
# Setting this to 'true' will make the release fail
unready: false

0 comments on commit d3b2a21

Please sign in to comment.