Fix kind logs not exported if tests failed
By default invoke exits if a run fails:
Because of that when the tests fail the task never exports the kind logs.
Adding warn="True" and handling the result manually should solve this.
@@ -641,12 +641,15 @@ def e2etest(ctx, name="kind", export=None, kubeconfig=None, system_namespaces="k
if ipv6_service_range is None:
ipv6_service_range = get_service_range(6)
- run("cd `git rev-parse --show-toplevel`/e2etest &&"
- "go test {} --provider=local --kubeconfig={} --service-pod-port={} -ipv4-service-range={} -ipv6-service-range={} {}".format(ginkgo_focus, kubeconfig, service_pod_port, ipv4_service_range, ipv6_service_range, opt_skip_docker))
+ testrun = run("cd `git rev-parse --show-toplevel`/e2etest &&"
+ "go test {} --provider=local --kubeconfig={} --service-pod-port={} -ipv4-service-range={} -ipv6-service-range={} {}".format(ginkgo_focus, kubeconfig, service_pod_port, ipv4_service_range, ipv6_service_range, opt_skip_docker), warn="True")
if export != None:
run("kind export logs {}".format(export))
+ if testrun.failed:
+ raise Exit(message="E2E tests failed", code=testrun.return_code)
+
@task
def bumplicense(ctx):
"""Bumps the license header on all go files that have it missing"""
