diff --git a/Makefile.core.mk b/Makefile.core.mk index 8c3c97434..6a7d69ec5 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -90,9 +90,10 @@ DOCKER_BUILD_FLAGS ?= "--platform=$(TARGET_OS)/$(TARGET_ARCH)" GOTEST_FLAGS := $(if $(VERBOSE),-v) $(if $(COVERAGE),-coverprofile=$(REPO_ROOT)/out/coverage-unit.out) GINKGO_FLAGS ?= $(if $(VERBOSE),-v) $(if $(CI),--no-color) $(if $(COVERAGE),-coverprofile=coverage-integration.out -coverpkg=./... --output-dir=out) -# Fail fast when keeping the environment on failure, to make sure we don't contaminate it with other resources. +# Fail fast when keeping the environment on failure, to make sure we don't contaminate it with other resources. Also make sure to skip cleanup so it won't be deleted. ifeq ($(KEEP_ON_FAILURE),true) GINKGO_FLAGS += --fail-fast +SKIP_CLEANUP = true endif # CHANNELS define the bundle channels used in the bundle. diff --git a/tests/e2e/integ-suite-kind.sh b/tests/e2e/integ-suite-kind.sh index 68cfeedc7..c9022a8a4 100755 --- a/tests/e2e/integ-suite-kind.sh +++ b/tests/e2e/integ-suite-kind.sh @@ -24,7 +24,6 @@ export MULTICLUSTER="${MULTICLUSTER:-false}" export IP_FAMILY="${IP_FAMILY:-ipv4}" export ISTIOCTL="${ISTIOCTL:-${ROOT}/bin/istioctl}" export KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-operator-integration-tests}" -export KEEP_ON_FAILURE="${KEEP_ON_FAILURE:-}" function check_prerequisites() { if ! command -v "${ISTIOCTL}" &> /dev/null; then @@ -42,22 +41,6 @@ function run_integration_tests() { fi } -function keep_on_failure() { - if [ $? -eq 0 ]; then - original_trap="${original_trap#*\'}" - eval "${original_trap%\'*}" - exit 0 - fi - - KUBECONFIG="${ARTIFACTS}/config" - if [ "${MULTICLUSTER}" == "true" ]; then - printf -v KUBECONFIG '%s:' "${KUBECONFIGS[@]}" - fi - - echo "The kind cluster has been kept due to a test failure." - echo "To access it use \`export KUBECONFIG=${KUBECONFIG%:}\`" -} - check_prerequisites source "${ROOT}/tests/e2e/setup/setup-kind.sh" @@ -67,9 +50,4 @@ export HUB="${KIND_REGISTRY}" # Workaround make inside make: ovewrite this variable so it is not recomputed in Makefile.core.mk export IMAGE="${HUB}/${IMAGE_BASE:-sail-operator}:${TAG:-latest}" -if [ "${KEEP_ON_FAILURE}" == "true" ]; then - original_trap="$(trap -p EXIT)" - trap keep_on_failure EXIT -fi - run_integration_tests