From e76e718967eac7c76d710d9acbc4634901e7abbe Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 7 Mar 2020 11:52:37 +0200 Subject: [PATCH] e2e: Use custom latency check for Istio 1.5 --- .circleci/config.yml | 24 +------ cmd/flagger/main.go | 3 + test/{e2e-tests.sh => e2e-istio-tests.sh} | 88 ++++++++++++++--------- test/e2e-istio.sh | 2 + 4 files changed, 59 insertions(+), 58 deletions(-) rename test/{e2e-tests.sh => e2e-istio-tests.sh} (85%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ecdc397e..48310eb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,7 @@ jobs: - run: test/container-build.sh - run: test/e2e-kind.sh - run: test/e2e-istio.sh - - run: test/e2e-tests.sh + - run: test/e2e-istio-tests.sh e2e-kubernetes-daemonset-testing: machine: true @@ -105,28 +105,6 @@ jobs: - run: test/e2e-kubernetes.sh - run: test/e2e-kubernetes-tests-deployment.sh - e2e-kubernetes-svc-testing: - machine: true - steps: - - checkout - - attach_workspace: - at: /tmp/bin - - run: test/container-build.sh - - run: test/e2e-kind.sh - - run: test/e2e-kubernetes.sh - - run: test/e2e-kubernetes-svc-tests.sh - - e2e-smi-istio-testing: - machine: true - steps: - - checkout - - attach_workspace: - at: /tmp/bin - - run: test/container-build.sh - - run: test/e2e-kind.sh - - run: test/e2e-smi-istio.sh - - run: test/e2e-tests.sh canary - e2e-gloo-testing: machine: true steps: diff --git a/cmd/flagger/main.go b/cmd/flagger/main.go index f12fa83c..d2eaafc3 100644 --- a/cmd/flagger/main.go +++ b/cmd/flagger/main.go @@ -125,6 +125,9 @@ func main() { } // use a remote cluster for routing if a service mesh kubeconfig is specified + if kubeconfigServiceMesh == "" { + kubeconfigServiceMesh = kubeconfig + } cfgHost, err := clientcmd.BuildConfigFromFlags(masterURL, kubeconfigServiceMesh) if err != nil { logger.Fatalf("Error building host kubeconfig: %v", err) diff --git a/test/e2e-tests.sh b/test/e2e-istio-tests.sh similarity index 85% rename from test/e2e-tests.sh rename to test/e2e-istio-tests.sh index a19ef5ed..31600601 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-istio-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # This script runs e2e tests for Canary, B/G and A/B initialization, analysis and promotion -# Prerequisites: Kubernetes Kind, Helm and Istio +# Prerequisites: Kubernetes Kind and Istio set -o errexit @@ -15,9 +15,36 @@ echo '>>> Installing the load tester' kubectl apply -k ${REPO_ROOT}/kustomize/tester kubectl -n test rollout status deployment/flagger-loadtester -echo '>>> Initialising canary' +echo '>>> Deploy podinfo' kubectl apply -f ${REPO_ROOT}/test/e2e-workload.yaml +echo '>>> Create latency metric template' +cat <>> Initialising canary' cat <>> Installing Istio ${ISTIO_VER}" ${REPO_ROOT}/bin/istio-${ISTIO_VER}/bin/istioctl manifest apply --set profile=default +kubectl -n istio-system rollout status deployment/prometheus + kubectl -n istio-system get all echo '>>> Load Flagger image in Kind'