From fe8510090dab09719e3340ecf1539c7eb12a7f59 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Tue, 21 Jan 2020 10:17:45 -0700 Subject: [PATCH 1/3] Bump sonobuoy version --- Dockerfile.test.dapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.test.dapper b/Dockerfile.test.dapper index 925b9cffae..ffada043f0 100644 --- a/Dockerfile.test.dapper +++ b/Dockerfile.test.dapper @@ -6,7 +6,7 @@ ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH RUN if [ "${ARCH}" == "amd64" ] || [ "${ARCH}" == "arm64" ]; then \ - VERSION=0.17.0 OS=linux && \ + VERSION=0.17.1 OS=linux && \ curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${VERSION}/sonobuoy_${VERSION}_${OS}_${ARCH}.tar.gz" | \ tar -xzf - -C /usr/local/bin; \ fi From 4ec28d270760d21d5941e5f1ee24ab6cb904a160 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Tue, 21 Jan 2020 10:22:04 -0700 Subject: [PATCH 2/3] Set conformance version from k8s version --- scripts/test-helpers | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/test-helpers b/scripts/test-helpers index 060fcd7e92..e9edf58458 100755 --- a/scripts/test-helpers +++ b/scripts/test-helpers @@ -189,8 +189,15 @@ sonobuoy-test() { return 0 fi echo 'Starting sonobuoy tests' + local VERSION_CONFORMANCE=$(sed -e 's/[-+].*$//g' <<< "$VERSION_K8S") + + sonobuoy run \ + --config=scripts/sonobuoy-config.json \ + --plugin-env=e2e.E2E_USE_GO_RUNNER=true \ + --kube-conformance-image-version=${VERSION_CONFORMANCE} \ + --wait=30 \ + $@ & - sonobuoy run --config=scripts/sonobuoy-config.json --plugin-env=e2e.E2E_USE_GO_RUNNER=true --wait=30 $@ & local sonobuoyPID=$! local code=0 time wait $sonobuoyPID || code=$? From 5117ea0ca7914b8fcafcd7b8dea328b0ddc2b2be Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Tue, 21 Jan 2020 11:07:12 -0700 Subject: [PATCH 3/3] Always exit 0 on tag for tests --- Dockerfile.test.dapper | 2 +- scripts/test | 4 ++-- scripts/test-helpers | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile.test.dapper b/Dockerfile.test.dapper index ffada043f0..088bb59468 100644 --- a/Dockerfile.test.dapper +++ b/Dockerfile.test.dapper @@ -19,7 +19,7 @@ RUN curl -sL https://storage.googleapis.com/kubernetes-release/release/$( \ ENV TEST_CLEANUP true ENV DAPPER_RUN_ARGS --privileged --network host -ENV DAPPER_ENV REPO TAG DRONE_TAG DRONE_SYSTEM_HOST IMAGE_NAME GCLOUD_AUTH +ENV DAPPER_ENV REPO TAG DRONE_TAG DRONE_BUILD_EVENT IMAGE_NAME GCLOUD_AUTH ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/ ENV DAPPER_OUTPUT ./dist ENV DAPPER_DOCKER_SOCKET true diff --git a/scripts/test b/scripts/test index 39c9032803..e7463e1b71 100755 --- a/scripts/test +++ b/scripts/test @@ -17,8 +17,8 @@ E2E_OUTPUT=$artifacts test-run-sonobuoy # --- -if [[ "$DRONE_SYSTEM_HOST" =~ 'publish' ]]; then - printf "\033[33mSkipping remaining tests on publish.\033[m\n" +if [ "$DRONE_BUILD_EVENT" = 'tag' ]; then + printf "\033[33mSkipping remaining tests on tag.\033[m\n" exit 0 fi diff --git a/scripts/test-helpers b/scripts/test-helpers index e9edf58458..d14d4941af 100755 --- a/scripts/test-helpers +++ b/scripts/test-helpers @@ -517,6 +517,9 @@ pid-cleanup() { else printf "\033[31m$failCount tests failed.\033[m\n" fi + if [ "$DRONE_BUILD_EVENT" = 'tag' ]; then + code=0 + fi echo exit $code } @@ -531,8 +534,10 @@ wait-pids() { for pid in "${pids[@]}"; do wait $pid || code=$? done - [ $code -eq 0 ] pid-cleanup + if [ "$DRONE_BUILD_EVENT" = 'tag' ]; then + code=0 + fi exit $code } export -f wait-pids