From 11192819ffdc6544bb4debad609696abbb012d36 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Thu, 30 Jan 2020 11:42:57 -0300 Subject: [PATCH] Dump kind logs after e2e tests (#4987) --- test/e2e/run.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 281d896f51..7f92e558a8 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -KIND_LOG_LEVEL="0" +KIND_LOG_LEVEL="1" if ! [ -z $DEBUG ]; then set -x @@ -25,6 +25,18 @@ set -o errexit set -o nounset set -o pipefail +cleanup() { + if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then + kind "export" logs --name ${KIND_CLUSTER_NAME} "${ARTIFACTS}/logs" || true + fi + + kind delete cluster \ + --verbosity=${KIND_LOG_LEVEL} \ + --name ${KIND_CLUSTER_NAME} +} + +trap cleanup EXIT + if ! command -v parallel &> /dev/null; then if [[ "$OSTYPE" == "linux-gnu" ]]; then echo "Parallel is not installed. Use the package manager to install it" @@ -56,6 +68,7 @@ kind create cluster \ --verbosity=${KIND_LOG_LEVEL} \ --name ${KIND_CLUSTER_NAME} \ --config ${DIR}/kind.yaml \ + --retain \ --image "kindest/node:${K8S_VERSION}" echo "Kubernetes cluster:" @@ -86,7 +99,3 @@ kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/httpbin:${TAG} echo "[dev-env] running e2e tests..." make -C ${DIR}/../../ e2e-test - -kind delete cluster \ - --verbosity=${KIND_LOG_LEVEL} \ - --name ${KIND_CLUSTER_NAME}