I currently have a problem where if the interface that I'm mocking out is called in a go routine the stack trace of a panic due to the mock not "expecting the call" will not contain the test that it failed on (which makes sense in general since the stack trace can only really go up to the start of the routine, not to what invoked it). I may have 10-100 different tests all mocking the same function for the same mock so it's very difficult to figure out which test actually mocked the function incorrectly (or didn't mock it).
I'm testing with ginkgo, and if you call GinkgoRecover() in the go routine that panics then it will include the test that it panicked on.
I was wondering if there is a way to a GinkgoRecover() into the start of all the mocked functions created for an interface. I'm also open to other suggestions for getting the test that failed.
Hi,
I currently have a problem where if the interface that I'm mocking out is called in a go routine the stack trace of a panic due to the mock not "expecting the call" will not contain the test that it failed on (which makes sense in general since the stack trace can only really go up to the start of the routine, not to what invoked it). I may have 10-100 different tests all mocking the same function for the same mock so it's very difficult to figure out which test actually mocked the function incorrectly (or didn't mock it).
I'm testing with ginkgo, and if you call
GinkgoRecover()
in the go routine that panics then it will include the test that it panicked on.I was wondering if there is a way to a
GinkgoRecover()
into the start of all the mocked functions created for an interface. I'm also open to other suggestions for getting the test that failed.