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

Prune stack traces produced by failing tests #3247

Closed
4 tasks done
juliette-derancourt opened this issue Apr 15, 2023 · 0 comments · Fixed by #3277
Closed
4 tasks done

Prune stack traces produced by failing tests #3247

juliette-derancourt opened this issue Apr 15, 2023 · 0 comments · Fixed by #3277

Comments

@juliette-derancourt
Copy link
Member

juliette-derancourt commented Apr 15, 2023

When a test fails, the outcome is a big stack trace containing a lot of internal JUnit/Java calls.
Since this is rarely interesting for the end user, we should prune this to keep only relevant assertion messages.

See related post found by @sormuras on Stackoverflow.

Deliverables

This pruning mechanism should:

  • be an opt-out feature that can be disabled via a system property or configuration parameter
  • prune elements coming from the org.junit, java, and jdk packages by default (with the exception of Jupiter Assertions and Assumptions calls)
  • prune all elements prior to and including the first JUnit Launcher call
  • optionally prune additional elements, based on another configuration parameter providing a list of fully qualified class name patterns (using the same syntax as junit.platform.execution.listeners.deactivate property)
@juliette-derancourt juliette-derancourt added this to the 5.10.0-M1 milestone Apr 15, 2023
@juliette-derancourt juliette-derancourt self-assigned this Apr 15, 2023
@sormuras sormuras self-assigned this Apr 21, 2023
juliette-derancourt added a commit that referenced this issue Apr 25, 2023
Resolves #3247

Co-authored-by: Christian Stein <sormuras@gmail.com>
juliette-derancourt added a commit that referenced this issue Apr 28, 2023
Resolves #3247

Co-authored-by: Christian Stein <sormuras@gmail.com>
juliette-derancourt added a commit that referenced this issue Apr 28, 2023
Resolves #3247

Co-authored-by: Christian Stein <sormuras@gmail.com>
juliette-derancourt added a commit that referenced this issue Apr 29, 2023
Resolves #3247

Co-authored-by: Christian Stein <sormuras@gmail.com>
juliette-derancourt added a commit that referenced this issue May 8, 2023
This commit introduces stack trace pruning, in order to make the stack traces produced by failing tests more concise and readable.
This is an opt-out feature that can be enabled or disabled with the `junit.platform.stacktrace.pruning.enabled` configuration property, and configured by providing a pattern to `junit.platform.stacktrace.pruning.pattern`.

Resolves #3247

Co-authored-by: Christian Stein <sormuras@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants