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

Assertion failures don't show full stacktrace #350

Open
smatting opened this issue Sep 16, 2022 · 0 comments
Open

Assertion failures don't show full stacktrace #350

smatting opened this issue Sep 16, 2022 · 0 comments

Comments

@smatting
Copy link

smatting commented Sep 16, 2022

It can be hard to figure out where in a test case assertions are failing. For example if the test case has multiple call sites of a helper function that might fail it's impossible to figure out which call site is raising the HUnitFailure, because only the lower most SrcLoc of the callstack is shown.

I propose to always include the full stack trace in HUniFailure.

Without a full stackrace you can be lost:

Tests
  Auth
    LoginId parser: valid email: FAIL
      test/unit/Test/Wire/API/User/Auth.hs:34:
      Some assertion failed. Try to find me!

In contrast:

Tests
  Auth
    LoginId parser: valid email: FAIL
      Error message: Some assertion failed. Try to find me!
      
      CallStack (from HasCallStack):
        assertFailure, called at test/unit/Test/Wire/API/User/Auth.hs:52:11 in main:Test.Wire.API.User.Auth
        helper2, called at test/unit/Test/Wire/API/User/Auth.hs:49:10 in main:Test.Wire.API.User.Auth
        helper, called at test/unit/Test/Wire/API/User/Auth.hs:34:3 in main:Test.Wire.API.User.Auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants