Fix tests not reporting the correct failure line
@@ -25,7 +25,7 @@ import (
)
func TestAcceptance(t *testing.T) {
- RegisterFailHandler(Fail)
+ RegisterFailHandler(FailWithReport)
RunSpecs(t, "Acceptance Suite")
}
@@ -129,8 +129,6 @@ var _ = SynchronizedBeforeSuite(func() []byte {
}, func(randomSuffix []byte) {
var err error
- RegisterFailHandler(FailWithReport)
-
nodeSuffix = fmt.Sprintf("%d-%s",
config.GinkgoConfig.ParallelNode, string(randomSuffix))
nodeTmpDir, err = ioutil.TempDir("", "epinio-"+nodeSuffix)
@@ -445,7 +443,8 @@ func FailWithReport(message string, callerSkip ...int) {
fmt.Print(out)
}
- Fail(message, callerSkip...)
+ // Ensures the correct line numbers are reported
+ Fail(message, callerSkip[0]+1)
}
func expectGoodInstallation() {
