Skip to content

Commit c271955

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

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/e2e/e2e_test.go

Lines changed: 13 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

@@ -35,6 +39,8 @@ var (
3539
"bitnami/nginx:latest",
3640
"dummy image to treat as an operator in tests")
3741

42+
junitDir = flag.String("junit-dir", "", "directory where junit report is generated")
43+
3844
testNamespace = ""
3945
operatorNamespace = ""
4046
communityOperatorsImage = ""
@@ -44,7 +50,13 @@ func TestEndToEnd(t *testing.T) {
4450
RegisterFailHandler(Fail)
4551
SetDefaultEventuallyTimeout(1 * time.Minute)
4652
SetDefaultEventuallyPollingInterval(1 * time.Second)
47-
RunSpecs(t, "End-to-end")
53+
54+
if os.Getenv("JUNIT_DIRECTORY") != "" {
55+
junitReporter := reporters.NewJUnitReporter(path.Join(os.Getenv("JUNIT_DIRECTORY"), fmt.Sprintf("junit_e2e_%02d.xml", config.GinkgoConfig.ParallelNode)))
56+
RunSpecsWithDefaultAndCustomReporters(t, "End-to-end", []Reporter{junitReporter})
57+
} else {
58+
RunSpecs(t, "End-to-end")
59+
}
4860
}
4961

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

0 commit comments

Comments
 (0)