-
Notifications
You must be signed in to change notification settings - Fork 311
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
Implement JUnit5 support and parameterize tests #4473
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blorente
requested review from
mai93,
jastice,
tpasternak and
estebandlc
as code owners
February 20, 2023 10:06
Closed
sgowroji
added
product: IntelliJ
IntelliJ plugin
topic: testing
awaiting-review
Awaiting review from Bazel team on PRs
labels
Feb 20, 2023
@mai93 please review. |
blorente
force-pushed
the
blroente/junit5-oss
branch
from
November 16, 2023 10:42
a5115d5
to
6468dfb
Compare
Rebased on top of |
mai93
reviewed
Nov 22, 2023
java/src/com/google/idea/blaze/java/run/JUnitTestHeuristic.java
Outdated
Show resolved
Hide resolved
java/src/com/google/idea/blaze/java/run/JUnitTestHeuristic.java
Outdated
Show resolved
Hide resolved
java/src/com/google/idea/blaze/java/run/JUnitTestHeuristic.java
Outdated
Show resolved
Hide resolved
java/src/com/google/idea/blaze/java/run/producers/BlazeJUnitTestFilterFlags.java
Outdated
Show resolved
Hide resolved
mai93
reviewed
Nov 22, 2023
.../tests/unittests/com/google/idea/blaze/java/run/producers/BlazeJUnitTestFilterFlagsTest.java
Show resolved
Hide resolved
mai93
reviewed
Nov 23, 2023
...sts/com/google/idea/blaze/java/run/producers/MultipleJavaClassesTestContextProviderTest.java
Show resolved
Hide resolved
blorente
force-pushed
the
blroente/junit5-oss
branch
from
January 25, 2024 11:31
087dfc3
to
5136a16
Compare
Addressed the comments, sorry for the delay but it was hard to find time, as per usual. |
# Conflicts: # examples/java/greetings_project/greeting_lib/BUILD
agluszak
approved these changes
Oct 3, 2024
github-actions
bot
removed
the
awaiting-review
Awaiting review from Bazel team on PRs
label
Oct 3, 2024
3 tasks
tpasternak
pushed a commit
that referenced
this pull request
Nov 27, 2024
The JUnit 5 selector for methods does not support a trailing #. This is easy to verify: ``` > java -jar junit-platform-console-standalone-<version>.jar execute -cp <my tests jar> --select-class=<my test class> ``` will work, while ``` > java -jar junit-platform-console-standalone-<version>.jar execute -cp <my tests jar> --select-class=<my test class># ``` will fail. This will change `--test_filter`'s value from `<my test class>#` to `<my test class>` when filtering for classes. The new value requires no postprocessing and is directly compatible with JUnit's selector "language". The trailing # was introduced in #4473. This undocumented breaking change created issues for our own test runner. Co-authored-by: João Guerra <joca-bt@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.
Discussion thread for this change
Issue number: #4433
Description of this change
Luckily, JUnit 4 test filters are compatible with JUnit 5.
Therefore, the only things that this PR needs to do are:
Change
JUnitTestHeuristic
to account for JUnit 5.Change the test filter generators to account for JUnit 5 as well.
Change the testbed so that it also tests against JUnit 5 code:
JUnitTestUtils
, a utility class to set up test repositories with JUnit 5 or 4 code.BlazeJUnitRunConfigurationProducerTestCase
, to remove parameterization boilerplate for the Run Configuration Producer tests.Implement fastbuild support for
java_junit5_test
:java_junit5_test
as an allowed target kind for FastBuild.main_class
attribute in the FastBuild aspect proto.main_class
when building run configurations over the default bazel runner (java_junit5_test
uses a custom test runner).