Skip to content

Commit

Permalink
Add e2e testing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Feb 24, 2019
1 parent ef423b2 commit ba65975
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
24 changes: 24 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Flagger end-to-end testing

The e2e testing infrastructure is powered by CircleCI and [Kubernetes Kind](https://github.com/kubernetes-sigs/kind).

CircleCI e2e workflow:

* install latest stable kubectl [e2e-kind.sh](e2e-kind.sh)
* build Kubernetes Kind from master [e2e-kind.sh](e2e-kind.sh)
* create local Kubernetes cluster with kind [e2e-kind.sh](e2e-kind.sh)
* install latest stable Helm CLI [e2e-istio.sh](e2e-istio.sh)
* deploy Tiller on the local cluster [e2e-istio.sh](e2e-istio.sh)
* install Istio CRDs with Helm [e2e-istio.sh](e2e-istio.sh)
* install Istio control plane and Prometheus with Helm [e2e-istio.sh](e2e-istio.sh)
* build Flagger container image [e2e-build.sh](e2e-build.sh)
* load Flagger image onto the local cluster [e2e-build.sh](e2e-build.sh)
* deploy Flagger in the istio-system namespace [e2e-build.sh](e2e-build.sh)
* create a test namespace with Istio injection enabled [e2e-tests.sh](e2e-tests.sh)
* deploy the load tester in the test namespace [e2e-tests.sh](e2e-tests.sh)
* deploy a demo workload (podinfo) in the test namespace [e2e-tests.sh](e2e-tests.sh)
* test the canary initialization [e2e-tests.sh](e2e-tests.sh)
* test the canary analysis and promotion [e2e-tests.sh](e2e-tests.sh)



12 changes: 8 additions & 4 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# This script runs e2e tests for Canary initialization, analysis and promotion
# Prerequisites: Kubernetes Kind, Helm and Istio

set -o errexit

REPO_ROOT=$(git rev-parse --show-toplevel)
Expand Down Expand Up @@ -66,7 +69,7 @@ until ${ok}; do
fi
done

echo '>>> Canary initialization test passed ✔︎'
echo ' Canary initialization test passed'

echo '>>> Triggering canary deployment'
kubectl -n test set image deployment/podinfo podinfod=quay.io/stefanprodan/podinfo:1.4.1
Expand All @@ -78,18 +81,19 @@ ok=false
until ${ok}; do
kubectl -n test describe deployment/podinfo-primary | grep '1.4.1' && ok=true || ok=false
sleep 5
kubectl -n istio-system logs deployment/flagger --tail 1
count=$(($count + 1))
if [[ ${count} -eq ${retries} ]]; then
kubectl -n test describe deployment/podinfo
kubectl -n test describe deployment/podinfo-canary
kubectl -n test describe deployment/podinfo-primary
kubectl -n istio-system logs deployment/flagger
echo "No more retries left"
exit 1
fi
done

echo '>>> Canary promotion test passed ✔︎'
echo ' Canary promotion test passed'

kubectl -n istio-system logs deployment/flagger

echo '>>> All tests passed ✔︎'
echo ' All tests passed'

0 comments on commit ba65975

Please sign in to comment.