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 errors cause tests to fail without a stack trace. #101

Closed
nuttycom opened this issue Aug 9, 2012 · 7 comments
Closed

Assertion errors cause tests to fail without a stack trace. #101

nuttycom opened this issue Aug 9, 2012 · 7 comments
Milestone

Comments

@nuttycom
Copy link
Contributor

nuttycom commented Aug 9, 2012

In the mutation-demanding (for efficiency purposes) parts of our codebase, we tend to use a lot of assertions to catch errors early. Unfortunately, specs2 seems to treat assertion failures specially - it doesn't provide any stack trace along with an assertion error, just the line number associated with the assertion. Seeing the call stack is really important to debugging in a lot of cases, because you have to be able to see how you got to a certain point, not just the point that you failed at. Is there a way to have assertion errors give a full stack trace in the spec output?

@etorreborre
Copy link
Owner

You can use the 'failtrace' command-line argument to see the stacktrace.

@nuttycom
Copy link
Contributor Author

nuttycom commented Aug 9, 2012

Thanks, Eric. Why do assertion failures behave differently from other kinds of exceptions?

@etorreborre
Copy link
Owner

That's to help with JUnit failures where JUnit throws AssertionErrors to notify of failures. I could actually improve my implementation by checking the stacktrace and either declaring a failure if thrown from JUnit or declaring an Error otherwise.

@etorreborre
Copy link
Owner

I just published a fix for this issue in the latest 1.12.1-SNAPSHOT (1.13 is reserved to Scala 2.10.0 next big-bang)

@nuttycom
Copy link
Contributor Author

Thanks a lot, Eric. Could you please cross-publish this (specifically for
2.9.1) so that my cross-publishing for blueeyes can work?

On Thu, Aug 9, 2012 at 7:10 PM, etorreborre notifications@github.comwrote:

I just published a fix for this issue in the latest 1.12.1-SNAPSHOT (1.13
is reserved to Scala 2.10.0 next big-bang)


Reply to this email directly or view it on GitHubhttps://github.com//issues/101#issuecomment-7631736.

@nuttycom
Copy link
Contributor Author

One more hassle...

Apparently, assertion failures blow through .pendingUntilFixed like
tornado-driven 2x4 through a Kansas mobile home. Meaning that you can't
.pendingUntilFixed away a failing assertion if you want to have a green
build. Is there something that can be done about this?

On Fri, Aug 10, 2012 at 10:01 AM, Kris Nuttycombe <kris.nuttycombe@gmail.com

wrote:

Thanks a lot, Eric. Could you please cross-publish this (specifically for
2.9.1) so that my cross-publishing for blueeyes can work?

On Thu, Aug 9, 2012 at 7:10 PM, etorreborre notifications@github.comwrote:

I just published a fix for this issue in the latest 1.12.1-SNAPSHOT (1.13
is reserved to Scala 2.10.0 next big-bang)


Reply to this email directly or view it on GitHubhttps://github.com//issues/101#issuecomment-7631736.

@etorreborre
Copy link
Owner

+publish with the fix for that is on the way,...

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

2 participants