Skip to content

Prune stack traces up to test or lifecycle method #4829

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

Merged

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Aug 11, 2025

Everything before the test method is invoked is not informative for the end user. Discarding that part of the stacktrace removes a few more uninformative frames.

Additionally, when pruning consider the source of the test descriptor not merely its ancestors.

Fixes: #4828


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@mpkorstanje mpkorstanje force-pushed the prune-stacktraces-up-to-test-method branch 2 times, most recently from dc3215e to 888f91f Compare August 11, 2025 14:36
@mpkorstanje mpkorstanje changed the title Prune stack traces up to test method Prune stack traces up to test or lifecycle method Aug 11, 2025
@mpkorstanje mpkorstanje force-pushed the prune-stacktraces-up-to-test-method branch from 888f91f to dfe4ade Compare August 11, 2025 14:41
Everything before the test method is invoked is not informative for the
end user. Discarding that part of the stacktrace removes a few more
frames.

Additionally, when pruning consider the source of the test descriptor
not merely its ancestors.

Fixes: junit-team#4828
@mpkorstanje mpkorstanje force-pushed the prune-stacktraces-up-to-test-method branch from dfe4ade to 13d039d Compare August 11, 2025 14:41
@marcphilipp marcphilipp requested a review from sormuras August 14, 2025 09:44
Copy link
Member

@sormuras sormuras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Removing the unlimited >>>> forward marker from the tests is what I expected to see.

@marcphilipp marcphilipp merged commit 824e0c8 into junit-team:main Aug 14, 2025
17 checks passed
@marcphilipp
Copy link
Member

Thanks, @mpkorstanje! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exceptions thrown by hooks are not completely pruned
3 participants