From 58de2e57a8006c185bf5b4726102b1744e0d0ecc Mon Sep 17 00:00:00 2001 From: Joakim Ahrlin Date: Thu, 25 Aug 2022 14:28:34 +0200 Subject: [PATCH 1/2] move e2e-ci to a script Signed-off-by: Joakim Ahrlin --- make/e2e-ci.sh | 18 ++++++++++++++++++ make/test.mk | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 make/e2e-ci.sh diff --git a/make/e2e-ci.sh b/make/e2e-ci.sh new file mode 100755 index 000000000..69a81f288 --- /dev/null +++ b/make/e2e-ci.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Copyright 2022 The cert-manager Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +make --no-print-directory e2e FLAKE_ATTEMPTS=2 K8S_VERSION="$(K8S_VERSION)" +make kind-logs diff --git a/make/test.mk b/make/test.mk index 5a010a19f..4262337ee 100644 --- a/make/test.mk +++ b/make/test.mk @@ -74,7 +74,7 @@ e2e: $(BINDIR)/scratch/kind-exists $(BINDIR)/tools/kubectl $(BINDIR)/tools/ginkg .PHONY: e2e-ci e2e-ci: e2e-setup-kind e2e-setup - $(MAKE) --no-print-directory e2e FLAKE_ATTEMPTS=2 K8S_VERSION="$(K8S_VERSION)" || ($(MAKE) kind-logs && exit 1) + make/e2e-ci.sh .PHONY: test-upgrade test-upgrade: | $(BINDIR)/tools/helm $(BINDIR)/tools/kind $(BINDIR)/tools/ytt $(BINDIR)/tools/kubectl $(BINDIR)/cmctl/cmctl-$(HOST_OS)-$(HOST_ARCH) From 6cfce6459ea9694edb8639a403ea915b2ffeb909 Mon Sep 17 00:00:00 2001 From: Joakim Ahrlin Date: Fri, 26 Aug 2022 11:46:48 +0200 Subject: [PATCH 2/2] set errexit, trap kind-logs Signed-off-by: Joakim Ahrlin --- make/e2e-ci.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make/e2e-ci.sh b/make/e2e-ci.sh index 69a81f288..f757ae7a1 100755 --- a/make/e2e-ci.sh +++ b/make/e2e-ci.sh @@ -14,5 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -o errexit +trap 'make kind-logs' EXIT make --no-print-directory e2e FLAKE_ATTEMPTS=2 K8S_VERSION="$(K8S_VERSION)" -make kind-logs