-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 reporting of @Ignored
JUnit 3 test classes
#3427
Fix reporting of @Ignored
JUnit 3 test classes
#3427
Conversation
… root description" This reverts commit ea3e7df.
@pshevche Thanks for the PR! I had some qualms about decorating |
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.
@marcphilipp , looks good from my side, thank you for getting it over the finish line 👍
Prior to this commit, `@Ignore`-annotated JUnit 3 test classes where reported as started and then as skipped due to their `Description` not including class-level annotations in some case. Co-authored-by: Marc Philipp <[email protected]>
@Ignored
JUnit 3 test classes
Overview
If JUnit3 test cases are annotated w/
@Ignore
and run w/ JUnit Vintage engine, they will be reported twice: once as started and once as skipped.This is caused by inconsistent checking for the annotation presence.
DefensiveAllDefaultPossibilitiesBuilder
will check for the annotation presence on the Java class to create anIgnoringRunnerDecorator
(ref), whileRunListenerAdapter
will look for the annotation on the runner'sDescription
to actually ignore the class (ref).So, if the Java class is annotated w/
@Ignore
, but the runner does no add it to the rootDescription
, then the test class will be once reported as started by theRunListenerAdapter
and once as skipped byIgnoringRunnerDecorator
. And this is exactly the case forJUnit38ClassRunner
which does not include class-level annotation in the runner's description (ref).In this PR, I propose to explicilty add
@Ignore
annotation for the JUnit3 runner's description and warn creators of custom runners about the missing annotation. I open this PR as a draft proposal first to discuss the approach.I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations