Add --report-prefix option

Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
James Munnelly 2018-10-18 14:38:45 +01:00
parent b60138c082
commit f8f4d003ec
2 changed files with 6 additions and 1 deletions

View File

@ -62,7 +62,10 @@ func TestE2E(t *testing.T) {
var r []ginkgo.Reporter
if framework.DefaultConfig.Ginkgo.ReportDirectory != "" {
r = append(r, reporters.NewJUnitReporter(path.Join(framework.DefaultConfig.Ginkgo.ReportDirectory, fmt.Sprintf("junit_%02d.xml", ginkgoconfig.GinkgoConfig.ParallelNode))))
r = append(r, reporters.NewJUnitReporter(path.Join(framework.DefaultConfig.Ginkgo.ReportDirectory,
fmt.Sprintf("junit_%s_%02d.xml",
framework.DefaultConfig.Ginkgo.ReportPrefix,
ginkgoconfig.GinkgoConfig.ParallelNode))))
}
ginkgo.RunSpecsWithDefaultAndCustomReporters(t, "cert-manager e2e suite", r)

View File

@ -20,10 +20,12 @@ import "flag"
type Ginkgo struct {
ReportDirectory string
ReportPrefix string
}
func (g *Ginkgo) AddFlags(fs *flag.FlagSet) {
fs.StringVar(&g.ReportDirectory, "report-dir", "", "Optional directory to store junit output in. If not specified, no junit file will be output")
fs.StringVar(&g.ReportPrefix, "report-prefix", "", "Optional prefix for JUnit XML reports. Default is empty, which doesn't prepend anything to the default name")
}
func (c *Ginkgo) Validate() []error {