diff --git a/test/README.md b/test/README.md index b338d303..3f8d586b 100644 --- a/test/README.md +++ b/test/README.md @@ -5,7 +5,7 @@ The e2e testing infrastructure is powered by CircleCI and [Kubernetes Kind](http CircleCI e2e workflow: * install latest stable kubectl [e2e-kind.sh](e2e-kind.sh) -* build Kubernetes Kind from master [e2e-kind.sh](e2e-kind.sh) +* install Kubernetes Kind [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) @@ -18,7 +18,7 @@ CircleCI e2e workflow: * 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) - +* test the canary analysis and promotion using weighted traffic and the load testing webhook [e2e-tests.sh](e2e-tests.sh) +* test the A/B testing analysis and promotion using cookies filters and pre/post rollout webhooks [e2e-tests.sh](e2e-tests.sh) diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index eed594b6..2ef1b7bc 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -42,7 +42,7 @@ spec: canaryAnalysis: interval: 15s threshold: 15 - maxWeight: 50 + maxWeight: 30 stepWeight: 10 metrics: - name: request-success-rate @@ -83,7 +83,6 @@ spec: type: cmd cmd: "hey -z 10m -q 10 -c 2 http://podinfo.test:9898/" logCmdOutput: "true" - EOF echo '>>> Waiting for primary to be ready' @@ -126,6 +125,77 @@ done echo '✔ Canary promotion test passed' +cat <>> Triggering A/B testing' +kubectl -n test set image deployment/podinfo podinfod=quay.io/stefanprodan/podinfo:1.4.2 + +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 + 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 '✔ A/B testing promotion test passed' + kubectl -n istio-system logs deployment/flagger echo '✔ All tests passed' \ No newline at end of file