From 52ed4c4ba9376cc7a31555813ecee8df94c31b6f Mon Sep 17 00:00:00 2001 From: Hasan Turken Date: Mon, 21 Nov 2022 14:54:49 +0300 Subject: [PATCH] Incorporate changes in https://github.com/upbound/provider-aws/pull/143 Signed-off-by: Hasan Turken --- Makefile | 18 ++++++++++++------ cluster/test/setup.sh | 18 ++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index c65490348..87f1d658c 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ GO111MODULE = on KIND_VERSION = v0.15.0 UP_VERSION = v0.14.0 UP_CHANNEL = stable -UPTEST_VERSION = v0.2.1 +UPTEST_VERSION = v0.3.0 -include build/makelib/k8s_tools.mk # ==================================================================================== @@ -157,22 +157,28 @@ CROSSPLANE_NAMESPACE = upbound-system -include build/makelib/controlplane.mk # This target requires the following environment variables to be set: -# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials) # - UPTEST_EXAMPLE_LIST, a comma-separated list of examples to test -# - UPTEST_DATASOURCE_PATH, see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource +# - UPTEST_CLOUD_CREDENTIALS (optional), cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/azure.json) +# - UPTEST_DATASOURCE_PATH (optional), see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --setup-script=cluster/test/setup.sh || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --data-source="${UPTEST_DATASOURCE_PATH}" --setup-script=cluster/test/setup.sh --default-conditions="Test" || $(FAIL) @$(OK) running automated tests uptest-local: @$(WARN) "this target is deprecated, please use 'make uptest' instead" +local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME) + @$(INFO) running locally built provider + @$(KUBECTL) wait provider.pkg $(PROJECT_NAME) --for condition=Healthy --timeout 5m + @$(KUBECTL) -n upbound-system wait --for=condition=Available deployment --all --timeout=5m + @$(OK) running locally built provider + # This target requires the following environment variables to be set: -# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials) +# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/azure.json) # - UPTEST_EXAMPLE_LIST, a comma-separated list of examples to test # - UPTEST_DATASOURCE_PATH, see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource -e2e: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME) uptest +e2e: local-deploy uptest .PHONY: uptest e2e diff --git a/cluster/test/setup.sh b/cluster/test/setup.sh index 551748698..85ad1fc91 100755 --- a/cluster/test/setup.sh +++ b/cluster/test/setup.sh @@ -2,17 +2,13 @@ set -aeuo pipefail echo "Running setup.sh" -echo "Creating cloud credential secret..." -${KUBECTL} -n upbound-system create secret generic provider-secret --from-literal=credentials="${UPTEST_CLOUD_CREDENTIALS}" --dry-run=client -o yaml | ${KUBECTL} apply -f - -echo "Waiting until provider is healthy..." -${KUBECTL} wait provider.pkg --all --for condition=Healthy --timeout 5m +if [[ -n "${UPTEST_CLOUD_CREDENTIALS:-}" ]]; then + echo "Creating cloud credential secret..." + ${KUBECTL} -n upbound-system create secret generic provider-secret --from-literal=credentials="${UPTEST_CLOUD_CREDENTIALS}" --dry-run=client -o yaml | ${KUBECTL} apply -f - -echo "Waiting for all pods to come online..." -${KUBECTL} -n upbound-system wait --for=condition=Available deployment --all --timeout=5m - -echo "Creating a default provider config..." -cat <