summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/ginkgo/reporters
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2019-11-01 10:10:57 +0000
committerValentin Rothberg <rothberg@redhat.com>2019-11-01 11:48:26 +0100
commite22777c3fcde4d2d55e9104567ed2107c15db9ff (patch)
tree2040f33104d71f14b3dacd1b2834c704d95c4819 /vendor/github.com/onsi/ginkgo/reporters
parent2dae2577ccbeef502a8783c892a6c9e346153532 (diff)
downloadpodman-e22777c3fcde4d2d55e9104567ed2107c15db9ff.tar.gz
podman-e22777c3fcde4d2d55e9104567ed2107c15db9ff.tar.bz2
podman-e22777c3fcde4d2d55e9104567ed2107c15db9ff.zip
Bump github.com/onsi/ginkgo from 1.10.1 to 1.10.3
Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.10.1 to 1.10.3. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v1.10.1...v1.10.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/onsi/ginkgo/reporters')
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go
index 89a7c8465..d76e2fe77 100644
--- a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go
+++ b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go
@@ -13,6 +13,7 @@ import (
"fmt"
"math"
"os"
+ "path/filepath"
"strings"
"github.com/onsi/ginkgo/config"
@@ -141,17 +142,29 @@ func (reporter *JUnitReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) {
reporter.suite.Time = math.Trunc(summary.RunTime.Seconds()*1000) / 1000
reporter.suite.Failures = summary.NumberOfFailedSpecs
reporter.suite.Errors = 0
- file, err := os.Create(reporter.filename)
+ if reporter.ReporterConfig.ReportFile != "" {
+ reporter.filename = reporter.ReporterConfig.ReportFile
+ fmt.Printf("\nJUnit path was configured: %s\n", reporter.filename)
+ }
+ filePath, _ := filepath.Abs(reporter.filename)
+ dirPath := filepath.Dir(filePath)
+ err := os.MkdirAll(dirPath, os.ModePerm)
+ if err != nil {
+ fmt.Printf("\nFailed to create JUnit directory: %s\n\t%s", filePath, err.Error())
+ }
+ file, err := os.Create(filePath)
if err != nil {
- fmt.Printf("Failed to create JUnit report file: %s\n\t%s", reporter.filename, err.Error())
+ fmt.Fprintf(os.Stderr, "Failed to create JUnit report file: %s\n\t%s", filePath, err.Error())
}
defer file.Close()
file.WriteString(xml.Header)
encoder := xml.NewEncoder(file)
encoder.Indent(" ", " ")
err = encoder.Encode(reporter.suite)
- if err != nil {
- fmt.Printf("Failed to generate JUnit report\n\t%s", err.Error())
+ if err == nil {
+ fmt.Fprintf(os.Stdout, "\nJUnit report was created: %s\n", filePath)
+ } else {
+ fmt.Fprintf(os.Stderr,"\nFailed to generate JUnit report data:\n\t%s", err.Error())
}
}