Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Output diff of expected and actual values in
ConsoleLauncher
#4017base: main
Are you sure you want to change the base?
Output diff of expected and actual values in
ConsoleLauncher
#4017Changes from 13 commits
e0d2849
bc1b464
2fa9a8e
50552b4
e8d11bd
7b4088d
bb29695
2c27b53
af16685
3d73d1e
c8a7b95
53d884c
26bcaa4
3248752
04f789a
983e090
eef49f1
bcd0608
cc69bfb
705b4cf
2383f3e
82f723a
536e9c7
f44f929
eef975b
de00ade
a3f8f25
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This should be done in place where we print the exceptions (as it is in #3397). Otherwise, it would be difficult to find the test that belongs to the diff in case of multiple failing tests.
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.
Which part do you wish to change? The first print happens in
DefaultLaucher
and the second happens inMutableTestExecutionSummary
. Both are injunit-platform-laucher
module. Changes will affect all Junit API output I believe?I can try to work on it over the weekend if you wish.
At the same time, can you help to find why the package documentation test case fails (Test cases can not find
diff package
once I add it to the module-info.java for documentation)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.
We also need to make sure that the diff is printed if a details mode other than
Details.NONE
,Details.SUMMARY
, orDetails.TREE
is used. We should be able to extract the diff-printing code to a separate class and call it fromMutableTestExecutionSummary
, and the other listeners (FlatPrintingListener
etc.).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.
The solutions I can think of:
junit-platform-commons...util.StringUtils
FlatPrintingListener
,TreePrintingListener
,VerboseTreePrintingListener
andMutableTestExecutionSummary
I will start to work on it if the solution looks right for you
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 think it should stay in junit-platform-console. Please create a separate
DiffPrinter
class or similar.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.
DiffPrinter
class has been added.FlatPrintingListener
andVerboseTreePrintingListener