Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow injection of GinkgoRecover into mock function definitions #411

Open
Brian-McM opened this issue Oct 1, 2021 · 1 comment
Open

Comments

@Brian-McM
Copy link

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.

@Brian-McM
Copy link
Author

Hi, I just wanted to ping on this issue, would be nice to have a way to trace these cases to the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant