When call RunSpecsWithCustomReporters with not current directory and it doesn't exist. Ginkgo print an error and stop running:
Failed to create JUnit report file: /tmp/not_exists_folder/junit.xml
open /tmp/not_exists_folder/junit.xml: no such file or directoryFailed to generate JUnit report
invalid argumentPASS
Ginkgo ran 1 suite in 930.288973ms
Test Suite Passed
I can produce this issue by this code below:
package main
import (
"testing"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
"github.com/onsi/gomega"
)
func TestSuite(t *testing.T) {
rpts := []ginkgo.Reporter{
reporters.NewJUnitReporter("/tmp/not_exists_folder/junit.xml"),
}
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecsWithCustomReporters(t, "Suite", rpts)
}
var _ = ginkgo.Describe("first", func() {
ginkgo.It("do something", func() {
})
})
I have workaround solution by called mkdir before run spec. But I think it would be nice if ginkgo can create directory before create a filename.
When call
RunSpecsWithCustomReporterswith not current directory and it doesn't exist. Ginkgo print an error and stop running:I can produce this issue by this code below:
I have workaround solution by called
mkdirbefore run spec. But I think it would be nice if ginkgo can create directory before create a filename.