From b44b50cebcc747d5e7a242d0ce94a1226e0f73cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Tue, 4 Oct 2022 12:57:00 +0200 Subject: [PATCH] chore: tries different envoy versions. (#21) --- .github/workflows/ci.yaml | 15 ++++++++++++++- e2e/docker-compose.yml | 2 +- e2e/tests.sh | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0282ec2..5cf07ad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,6 +13,15 @@ env: GO_VERSION: 1.18 TINYGO_VERSION: 0.25.0 WABT_VERSION: 1.0.29 + # The SHA of the envoy version comes from https://github.com/istio/proxy/blob/master/WORKSPACE#L42 + # Here we aim to support: + # - istio 1.5.0 envoy version + # - istio 1.5.1 envoy version + # - latest envoy master + ENVOY_IMAGES: > + envoyproxy/envoy:v1.23-latest + envoyproxy/envoy-dev:1c86bac121ae73cefcba64ec0a863707b6cb8158 + envoyproxy/envoy-dev:latest jobs: build: @@ -61,7 +70,11 @@ jobs: run: go run mage.go coverage - name: Run e2e tests - run: go run mage.go e2e + shell: bash + run: > + for image in $ENVOY_IMAGES; do + ENVOY_IMAGE=$image go run mage.go e2e + done - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index ca5028f..4a495e4 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -1,6 +1,6 @@ services: envoy: - image: envoyproxy/envoy:v1.23-latest + image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.23-latest} command: - -c - /conf/envoy-config.yaml diff --git a/e2e/tests.sh b/e2e/tests.sh index 31e0d8b..e1421bd 100755 --- a/e2e/tests.sh +++ b/e2e/tests.sh @@ -20,7 +20,7 @@ while [[ "$status_code" -eq "000" ]]; do status_code=$(curl --write-out "%{http_code}" --silent --output /dev/null $health_url) sleep 1 echo -ne "[Wait] Waiting for response from $health_url. Timeout: ${max_retries}s \r" - ((max_retries-=1)) + max_retries=$((max_retries-1)) if [[ "$max_retries" -eq 0 ]] ; then echo "[Fail] Timeout waiting for response from $health_url, make sure the server is running." exit 1 @@ -29,7 +29,7 @@ done echo -e "\n[Ok] Got status code $status_code, expected 200. Ready to start." # Testing envoy container reachability with an unfiltered request -((step+=1)) +step=$((step+1)) echo "[$step/$total_steps] Testing true negative request" status_code=$(curl --write-out "%{http_code}" --silent --output /dev/null $unfiltered_url) if [[ "$status_code" -ne 200 ]] ; then @@ -39,7 +39,7 @@ fi echo "[Ok] Got status code $status_code, expected 200" # Testing filtered request -((step+=1)) +step=$((step+1)) echo "[$step/$total_steps] Testing true positive request" status_code=$(curl --write-out "%{http_code}" --silent --output /dev/null $filtered_url) if [[ "$status_code" -ne 403 ]] ; then