-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
[FLINK-23255][test] Introduce JUnit 5 dependencies #16551
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 58f4488 (Wed Jul 21 07:34:46 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
@@ -1578,7 +1591,7 @@ under the License. | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-surefire-plugin</artifactId> | |||
<version>2.22.1</version> | |||
<version>2.22.2</version> |
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.
Why is this being bumped?
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.
Thanks for the review @zentol! 2.22.2 fixed a bug related to junit-vintage-engine, so I bumped the version.
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.
I have verified that the test count is plausible, however from the AZP run, I could not assess if JUnit5 is actually used. The easiest way would be to temporarily add a test that fails and look at the stack trace.
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-migrationsupport</artifactId> |
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.
Do we even need this? Afaik this is for using JUnit4 rules in JUnit5 tests.
I had expected instead to see the vintage runner.
Same comment for the other modules.
Thanks for the review @AHeise ! Sorry for misunderstanding the usage of About validating whether Jupiter engine is truly used, I tried to check the stack trace but found that the stack is different under different execution environments. For example Intellij IDEA has its own engine so I can't capture keyword "jupiter" in the stack trace. Instead I added a temp test class |
Yes but I think you need to add
Sounds good to me and is a neat idea. We can double-check if the test count is the same and your new test appears on AZP and then this PR is good to go. |
@AHeise Thanks again for the review! I made a rebase to sync with the latest master. I manually ran CI twice in my own AZP project, one with the JUnit 5 dependencies[1] and another without[2]. Number of tests are almost identical to each other (59,186 vs 59,189) only with slight diffs. Missing tests with JUnit5 dependencies:
Interesting thing is that all these tests are annotated with Additional tests with JUnit5 dependencies:
In general, I think all test cases are covered with by vintage engine, and new Jupiter engine is validated by [1] With JUnit 5: https://dev.azure.com/renqs/Apache%20Flink/_build/results?buildId=42&view=ms.vss-test-web.build-test-results-tab |
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.
LGTM.
I'm assuming that one additional test was ignored on master or whatever you compared with.
Let me know if I should merge. It would be best to do it at a time when you can also check if it causes issues with subsequent builds.
[FLINK-23255][test] Introduce JUnit 5 dependencies. All existing JUnit4 tests are run through the vintage runner of JUnit5.
[FLINK-23255][test] Introduce JUnit 5 dependencies. All existing JUnit4 tests are run through the vintage runner of JUnit5.
)" This reverts commit 803fb8c.
[FLINK-23255][test] Introduce JUnit 5 dependencies. All existing JUnit4 tests are run through the vintage runner of JUnit5.
What is the purpose of the change
This pull request introduces JUnit 5 dependencies into Flink project so that developers can write JUnit 5 style test cases.
Brief change log
junit-jupiter
dependency in root pomjunit-vintage-engine
andjunit-jupiter-migrationsupport
dependency for supporting existing JUnit 4 test cases.Verifying this change
This change is already covered by all existing tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation