Skip to content

Commit bcca273

Browse files
authored
Merge pull request kubernetes-sigs#10493 from chrischdi/pr-kubetest-always-gather-junit
🐛 kubetest: also gather junit reports in case of errors observed from ginkgo
2 parents 0b61de1 + df6c93e commit bcca273

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/framework/kubetest/run.go

Lines changed: 5 additions & 1 deletion
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)