Skip to content

Commit ea45d39

Browse files
committed
Modify prow ci logging for e2e tests
Signed-off-by: Harish <[email protected]>
1 parent d23b7ab commit ea45d39

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/e2e/e2e_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ package e2e
33
import (
44
"context"
55
"flag"
6+
"fmt"
67
"os"
8+
"path"
79
"testing"
810
"time"
911

1012
. "github.com/onsi/ginkgo"
13+
"github.com/onsi/ginkgo/config"
14+
"github.com/onsi/ginkgo/reporters"
1115
. "github.com/onsi/gomega"
1216
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1317

@@ -44,7 +48,13 @@ func TestEndToEnd(t *testing.T) {
4448
RegisterFailHandler(Fail)
4549
SetDefaultEventuallyTimeout(1 * time.Minute)
4650
SetDefaultEventuallyPollingInterval(1 * time.Second)
47-
RunSpecs(t, "End-to-end")
51+
52+
if junitDir := os.Getenv("JUNIT_DIRECTORY"); junitDir != "" {
53+
junitReporter := reporters.NewJUnitReporter(path.Join(junitDir, fmt.Sprintf("junit_e2e_%02d.xml", config.GinkgoConfig.ParallelNode)))
54+
RunSpecsWithDefaultAndCustomReporters(t, "End-to-end", []Reporter{junitReporter})
55+
} else {
56+
RunSpecs(t, "End-to-end")
57+
}
4858
}
4959

5060
var deprovision func() = func() {}

0 commit comments

Comments
 (0)