-
Notifications
You must be signed in to change notification settings - Fork 23
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
Close #92 - Test report does not have any message from test failure #93
Close #92 - Test report does not have any message from test failure #93
Conversation
Sorry for the delay @kevin-lee. Doesn't seem like there's much we can do. Here is the line of code that prints things: The only option would be to override "printStackTrace" on a custom exception class. I would be tempted to do that to be honest. (Dodgy, I know) Otherwise, or in any case, did you mind linking to the code above and I'll merge after that. |
@charleso Having a custom exception with |
3956221
to
5420948
Compare
@charleso I made <?xml version='1.0' encoding='UTF-8'?>
<testsuite hostname="K-MP.local" name="io.kevinlee.property_based_testing.MyAppSpecWithHedgehog" tests="1" errors="0" failures="1" skipped="0" time="0.023" timestamp="2019-07-17T23:30:44">
<properties>
<!-- omitted -->
</properties>
<testcase classname="io.kevinlee.property_based_testing.MyAppSpecWithHedgehog" name="add(a, b) should return a + b" time="0.023">
<failure message="x: 1
y: 1
=== Not Equal ===
2
3" type="hedgehog.sbt.StackTraceMutedException"></failure>
</testcase>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite> |
5420948
to
f5e5f38
Compare
I'm easy, but I would be tempted to rename it If you prefer |
|
||
/** | ||
* This exception ignores printStackTrace with the given PrintStream or PrintWriter argument | ||
* in order to avoid printing noisy and useless stacktrace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would necessarily say "useless" here. It's more "misleading" because the stacktrace is coming from here and not the assertion. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah you're right. I'll fix it.
@charleso That's good. My first choice was |
f5e5f38
to
de8785c
Compare
Close #92 - Test report does not have any message from test failure
When if fails, the test report may look like
To compare with other testing tools, I've also provided the reports from ScalaCheck and ScalaTest. It's not the same test though.
As you can see, ScalaCheck uses
java.lang.Exception
whereas ScalaTest uses its own example namedorg.scalatest.exceptions.TestFailedException
. I made Hedgehog usejava.lang.AssertionError
for failure message but not sure what it should be.Do you have any suggestion?