From 312ebaf39b3cbf0979afb99967da2af59a0defe7 Mon Sep 17 00:00:00 2001 From: spacewander Date: Mon, 29 Jul 2024 15:34:46 +0800 Subject: [PATCH] add smoking test Signed-off-by: spacewander --- .github/workflows/release-branch.yml | 5 +++++ e2e/Makefile | 4 ++++ e2e/istio.sh | 19 +++++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml index 78274ba0..5015a1d8 100644 --- a/.github/workflows/release-branch.yml +++ b/.github/workflows/release-branch.yml @@ -45,6 +45,11 @@ jobs: helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done done + - name: Smoking test + working-directory: ./e2e + run: | + make create-cluster deploy-istio-to-verify-helm-install + - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 with: diff --git a/e2e/Makefile b/e2e/Makefile index 69cb795f..32feb15a 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -58,6 +58,10 @@ e2e-prepare-data-plane-image: kind deploy-istio: helm ISTIO_VERSION=$(ISTIO_VERSION) LOCALBIN=$(LOCALBIN) ./istio.sh install +.PHONY: deploy-istio-to-verify-helm-install +deploy-istio-to-verify-helm-install: helm + ISTIO_VERSION=$(ISTIO_VERSION) LOCALBIN=$(LOCALBIN) ./istio.sh installWithoutOptions + .PHONY: run-e2e run-e2e: PATH=$(LOCALBIN):"$(PATH)" go test -v ./... || (bash -x ./collect_e2e_logs.sh; exit -1) diff --git a/e2e/istio.sh b/e2e/istio.sh index 67aa767d..29488817 100755 --- a/e2e/istio.sh +++ b/e2e/istio.sh @@ -21,6 +21,8 @@ HELM="${LOCALBIN}/helm" E2E_DIR="$(pwd)" install() { + OPTIONS_DISABLED="$1" + pushd ../manifests/charts $HELM dependency update htnn-controller @@ -28,10 +30,19 @@ install() { $HELM package htnn-controller htnn-controller $HELM package htnn-gateway htnn-gateway - $HELM install htnn-controller htnn-controller --namespace istio-system --create-namespace --wait -f "$E2E_DIR/htnn_controller_values.yaml" \ + CONTROLLER_VALUES_OPT="-f $E2E_DIR/htnn_controller_values.yaml" + GATEWAY_VALUES_OPT="-f $E2E_DIR/htnn_gateway_values.yaml" + if [ -n "$OPTIONS_DISABLED" ]; then + CONTROLLER_VALUES_OPT= + GATEWAY_VALUES_OPT= + fi + + # shellcheck disable=SC2086 + $HELM install htnn-controller htnn-controller --namespace istio-system --create-namespace --wait $CONTROLLER_VALUES_OPT \ || exitWithAnalysis - $HELM install htnn-gateway htnn-gateway --namespace istio-system --create-namespace -f "$E2E_DIR/htnn_gateway_values.yaml" \ + # shellcheck disable=SC2086 + $HELM install htnn-gateway htnn-gateway --namespace istio-system --create-namespace $GATEWAY_VALUES_OPT \ && \ (kubectl wait --timeout=5m -n istio-system deployment/istio-ingressgateway --for=condition=Available \ || exitWithAnalysis) @@ -39,6 +50,10 @@ install() { popd } +installWithoutOptions() { + install WithoutOptions +} + exitWithAnalysis() { kubectl get pods -n istio-system -o yaml for pod in $(kubectl get pods -n istio-system | grep 'istiod-' | awk '{print $1}'); do