diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index 3d654c15..5fb75fe1 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This script runs e2e tests for Canary initialization, analysis and promotion +# This script runs e2e tests for Canary, B/G and A/B initialization, analysis and promotion # Prerequisites: Kubernetes Kind, Helm and Istio set -o errexit @@ -130,6 +130,64 @@ if [[ "$1" = "canary" ]]; then exit 0 fi +cat <>> Triggering B/G deployment' +kubectl -n test set image deployment/podinfo podinfod=quay.io/stefanprodan/podinfo:1.4.2 + +echo '>>> Waiting for B/G promotion' +retries=50 +count=0 +ok=false +until ${ok}; do + kubectl -n test describe deployment/podinfo-primary | grep '1.4.2' && ok=true || ok=false + sleep 10 + 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-primary + kubectl -n istio-system logs deployment/flagger + echo "No more retries left" + exit 1 + fi +done + +echo '✔ B/G promotion test passed' + cat <>> Triggering A/B testing' -kubectl -n test set image deployment/podinfo podinfod=quay.io/stefanprodan/podinfo:1.4.2 +kubectl -n test set image deployment/podinfo podinfod=quay.io/stefanprodan/podinfo:1.4.3 echo '>>> Waiting for A/B testing promotion' retries=50 count=0 ok=false until ${ok}; do - kubectl -n test describe deployment/podinfo-primary | grep '1.4.2' && ok=true || ok=false + kubectl -n test describe deployment/podinfo-primary | grep '1.4.3' && ok=true || ok=false sleep 10 kubectl -n istio-system logs deployment/flagger --tail 1 count=$(($count + 1))