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

Commit

Permalink
e2e: delete global (Flux) resources in teardowns
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco committed Nov 4, 2019
1 parent a0af3b4 commit 8dc349e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
9 changes: 1 addition & 8 deletions test/e2e/10_helm_chart.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ function setup() {
}

function teardown() {
# For debugging purposes (in case the test fails)
echo '>>> Flux logs'
kubectl -n "${FLUX_NAMESPACE}" logs deployment/flux
echo '>>> List pods'
kubectl -n "${DEMO_NAMESPACE}" get pods
echo '>>> Check workload'
kubectl -n "${DEMO_NAMESPACE}" rollout status deployment/podinfo

# Removing Flux also takes care of the global resources it installs.
uninstall_flux_with_helm
uninstall_tiller
# Removing the namespace also takes care of removing gitsrv.
Expand Down
10 changes: 2 additions & 8 deletions test/e2e/11_fluxctl_install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@ function setup() {
}

function teardown() {
# For debugging purposes (in case the test fails)
echo '>>> Flux logs'
kubectl -n "${FLUX_NAMESPACE}" logs deployment/flux
echo '>>> List pods'
kubectl -n "${DEMO_NAMESPACE}" get pods
echo '>>> Check workload'
kubectl -n "${DEMO_NAMESPACE}" rollout status deployment/podinfo

# Removing Flux also takes care of the global resources it installs.
uninstall_flux_with_fluxctl
# Removing the namespace also takes care of removing Flux and gitsrv.
kubectl delete namespace "$FLUX_NAMESPACE"
# Only remove the demo workloads after Flux, so that they cannot be recreated.
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/12_sync.bats
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ function setup() {
}

function teardown() {
# Teardown the created port-forward to gitsrv and restore Git settings.
kill "$git_port_forward_pid"
unset GIT_SSH_COMMAND
# Removing the namespace also takes care of removing Flux and gitsrv.
# Uninstall Flux and the global resources it installs.
uninstall_flux_with_fluxctl
# Removing the namespace also takes care of removing gitsrv.
kubectl delete namespace "$FLUX_NAMESPACE"
# Only remove the demo workloads after Flux, so that they cannot be recreated.
kubectl delete namespace "$DEMO_NAMESPACE"
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/20_commit_signing.bats
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ function setup() {
}

function teardown() {
# Teardown the created port-forward to gitsrv and restore Git settings.
kill "$git_port_forward_pid"
unset GIT_SSH_COMMAND
# Uninstall Flux and the global resources it installs.
uninstall_flux_gpg
# Removing the namespace also takes care of removing Flux and gitsrv.
kubectl delete namespace "$FLUX_NAMESPACE"
# Only remove the demo workloads after Flux, so that they cannot be recreated.
Expand Down

0 comments on commit 8dc349e

Please sign in to comment.