onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.12k stars 644 forks source link

GinkoT().Error[f]: record error instead of aborting the test #1331

Closed pohly closed 6 months ago

pohly commented 6 months ago

Ginkgo is built around the assumption that all failed assertions are fatal, i.e. testing must stop. This has the effect that GinkgoT().Error and GinkgoT().Errorf behave like GinkgoT().Fatal[f].

It would be nice to support the normal testing.T semantic and not abort the test.

Alternatively (or perhaps as a interim solution) this limitation should at least get documented.

onsi commented 6 months ago

I'll document it - but don't have plans to change the behavior of Fail().

pohly commented 6 months ago

Fail shouldn't change. It's GinkgoT().Error error which is currently a bit odd. But not changing it is fine.