From d7f48ec40ad1c8d5c58fe2065dac6975dcfaf267 Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Tue, 23 Apr 2024 14:09:01 +0200 Subject: [PATCH] kubetest: also gather junit reports in case of errors observed from ginkgo --- test/framework/kubetest/run.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/framework/kubetest/run.go b/test/framework/kubetest/run.go index 59fa0d7ef8ba..d4c1fc8ea6a2 100644 --- a/test/framework/kubetest/run.go +++ b/test/framework/kubetest/run.go @@ -31,6 +31,7 @@ import ( "github.com/onsi/ginkgo/v2" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/rand" "k8s.io/client-go/discovery" "k8s.io/client-go/tools/clientcmd" @@ -204,7 +205,10 @@ func Run(ctx context.Context, input RunInput) error { RestartPolicy: dockercontainer.RestartPolicyDisabled, }, ginkgo.GinkgoWriter) if err != nil { - return errors.Wrap(err, "Unable to run conformance tests") + return kerrors.NewAggregate([]error{ + errors.Wrap(err, "Unable to run conformance tests"), + framework.GatherJUnitReports(reportDir, input.ArtifactsDirectory), + }) } return framework.GatherJUnitReports(reportDir, input.ArtifactsDirectory) }