-
Notifications
You must be signed in to change notification settings - Fork 1
Fix ParameterizedTests suppressing PreconditionViolationException
#1
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
Fix ParameterizedTests suppressing PreconditionViolationException
#1
Conversation
… don't fail the tests
kazk
left a comment
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 don't mind changing to use 4 spaces, but can you commit separately?
| } else { | ||
| String formattedMessage = formatMessage(msg); | ||
| String formattedStackTrace = formatMessage(readStackTrace(throwable)); | ||
| System.out.printf("\n<ERROR::>%s<:LF:><:LF:>Stack trace:<:LF:><:LF:>%s\n", formattedMessage, formattedStackTrace); |
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.
Is there a reason not to collapse the stack trace like above (L176)?
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.
Well my reasoning was that a collapsed stacktrace does not necessarily represent a (potentially severe) problem with runtime but more a failing test case. I thought that since it's an internal error of JUnit, it deserves to crash hard. But it's just what I thought, can change it to whatever you prefer.
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.
Makes sense. Can you still put them in a separate container? Just don't add -. I think that's more readable.
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.
Here it is. I am not sure I like how the stacktrace now looks logically separate from the error, but if you prefer it this way, then fine.
BTW stacktraces in log panel look much better than in the ERROR:: panel due to lack of excessive line wrapping. Would it be possible to make the error panel behave in similar way as log panels? Maybe this would also solve the readability issue.
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.
Can you post a screenshot? I saw the original on Discord, but can you also repost that here, so it's easier to compare?
I'll look into the excessive line wrapping.
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.
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.
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.
Yeah, the last one might be the best. I think "Stack Trace:" can be removed.
I'll fix the CSS and let you know.
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.
Deployed the CSS change.
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.
Is there a reason not to collapse the stack trace like above (L176)?
Now I see what you mean, and it was a copy/paste mistake that outputError used collapsible LOG:: in one branch, and ERROR:: in another. I changed both branches in outputError to use ERROR:: and I think that after your fix to CSS, it looks good.
outputFailure uses collapsed LOG:: as it has been all the time.
This was unintentional, IDE did this. I did notice the large diff, but I thought these were Windows line breaks. I will try to revert the change in whitespace. |
ParameterizedTests suppressing PreconditionViolationException and not failing the tests
ParameterizedTests suppressing PreconditionViolationException and not failing the testsParameterizedTests suppressing PreconditionViolationException




Fixes codewars/runner#230 .
Example test suite which showcases various possible test outcomes: