Skip to content

Commit

Permalink
[e2e] add junit output for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
detiber committed Oct 28, 2019
1 parent d8deb7e commit ba3ef04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ config/samples
manager_image_patch.yaml-e
manager_pull_policy.yaml-e

# junit files
junit.*.xml

.DS_Store
12 changes: 11 additions & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (
"text/template"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/config"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -61,7 +63,15 @@ import (

func TestE2e(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "e2e Suite")

// If running in prow, output the junit files to the artifacts path
junitPath := fmt.Sprintf("junit.e2e_suite.%d.xml", config.GinkgoConfig.ParallelNode)
artifactPath, exists := os.LookupEnv("ARTIFACTS")
if exists {
junitPath = path.Join(artifactPath, junitPath)
}
junitReporter := reporters.NewJUnitReporter(junitPath)
RunSpecsWithDefaultAndCustomReporters(t, "e2e Suite", []Reporter{junitReporter})
}

const (
Expand Down

0 comments on commit ba3ef04

Please sign in to comment.