Skip to content

Commit d7f48ec

Browse files
chrischdik8s-infra-cherrypick-robot
authored and
k8s-infra-cherrypick-robot
committed
kubetest: also gather junit reports in case of errors observed from ginkgo
1 parent 877d16c commit d7f48ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/framework/kubetest/run.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/onsi/ginkgo/v2"
3232
"github.com/pkg/errors"
3333
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
34+
kerrors "k8s.io/apimachinery/pkg/util/errors"
3435
"k8s.io/apimachinery/pkg/util/rand"
3536
"k8s.io/client-go/discovery"
3637
"k8s.io/client-go/tools/clientcmd"
@@ -204,7 +205,10 @@ func Run(ctx context.Context, input RunInput) error {
204205
RestartPolicy: dockercontainer.RestartPolicyDisabled,
205206
}, ginkgo.GinkgoWriter)
206207
if err != nil {
207-
return errors.Wrap(err, "Unable to run conformance tests")
208+
return kerrors.NewAggregate([]error{
209+
errors.Wrap(err, "Unable to run conformance tests"),
210+
framework.GatherJUnitReports(reportDir, input.ArtifactsDirectory),
211+
})
208212
}
209213
return framework.GatherJUnitReports(reportDir, input.ArtifactsDirectory)
210214
}

0 commit comments

Comments
 (0)