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

junit5: pass static nested classes to the launcher #195

Merged

Conversation

gaurav-narula
Copy link
Contributor

This change iterates over all the static nested classes of the test class and adds them to LauncherDiscoveryRequestBuilder to allow running tests within static nested classes.

While Java allows more than one level of nesting, we limit our search to one level of nesting at the moment.

Junit4 tests annotated with RunWith(Enclosed.class) need to be special cased.

Refer: gradle/gradle#4427

This change iterates over all the static nested classes of the test
class and adds them to LauncherDiscoveryRequestBuilder to allow running
tests within static nested classes.

While Java allows more than one level of nesting, we limit our search to
one level of nesting at the moment.

Junit4 tests annotated with `RunWith(Enclosed.class)` need to be special
cased.

Refer: gradle/gradle#4427
@gaurav-narula gaurav-narula force-pushed the junit5-static-nested-classes-oss branch from 12498e3 to 88d60fb Compare August 15, 2023 18:09
Copy link
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for the PR, and nice catch!

@shs96c shs96c merged commit d82900b into bazel-contrib:main Aug 15, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants