-
Notifications
You must be signed in to change notification settings - Fork 80
Update java_junit5_test to support a main_class attribute #382
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
base: main
Are you sure you want to change the base?
Update java_junit5_test to support a main_class attribute #382
Conversation
mzeren-vmw
left a comment
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 LGTM, and test works for me.
|
The main thing that the |
There's quite a lot of functionality in https://github.com/bazel-contrib/rules_jvm/blob/main/java/private/junit5.bzl related to system properties and jvm_flags.
In our case, we wrapped the default |
|
@shs96c - Could you take a look at the additional logic in |
|
If you're changing My $0.02 is that from a maintainability perspective I don't love adding a The alternative is for you to copy the This makes me think that perhaps moving the |
Summary
Updates the
java_junit5_testrule to support amain_classattribute and pass it on tojava_testif provided. The default value remains unchanged.Problem
The standard
java_testhas a defaultmain_classbut allows users to override the value with a different class. The functionality is not available forjava_junit5_test. There is other functionality in the rule which is useful and should not be duplicated to a duplicate rule definition.Solution
Instead of passing a hard-coded value for
main_class, this change addsmain_classas a part of the function definition so it can be optionally provided.Testing
Added test cases for the default and overridden behavior under
examples/tests_and_lints.