-
Notifications
You must be signed in to change notification settings - Fork 9k
HDFS-17719. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-hdfs-httpfs Part1. #7371
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
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@cnauroth @ayushtkn This is the first unit test upgrade pr for HDFS. Can you help review this PR? Thank you very much! This PR may provide additional information as follows: The following JUnit 4 classes have been removed in JUnit 5:
We will use JUnit 5's This PR may have some Checkstyle issues in the end, but I don’t plan to fix them for now, as doing so could introduce additional code changes. I plan to address these issues after all JUnit 4 to JUnit 5 upgrades are completed. The list of Checkstyle issues is as follows:
|
🎊 +1 overall
This message was automatically generated. |
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.
+1. Thank you, @slfan1989 .
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.
Sorry that I am new to jupiter.api.extension
. So I am not able to review those changes. Please see if someone else could review them. If not, I suggest separating them to another PR and commit the other changes first.
+1 the other changes looks good.
@szetszwo Thank you for your message! After carefully reviewing the code, I found that we may not be able to split it into two PRs. The main reason is that most of the HttpFS unit tests inherit from Let me briefly describe the purpose of these methods.
The BeforeEachCallback interface allows us to perform custom actions before each test method is executed. It is part of JUnit 5's extension model and can be used to perform initialization tasks before each test method runs.
The AfterEachCallback interface allows us to perform custom actions after each test method has been executed. It is commonly used for cleaning up resources, resetting states, or performing other tasks.
The TestExecutionExceptionHandler interface allows us to handle exceptions thrown during the execution of a test method. You can use it to customize the handling of exceptions, allowing certain exceptions to be suppressed or transformed into other types of exceptions. hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java Let's take The core logic of JUnit 4.
In JUnit 5, we execute Step 1 in
The purpose of Overall, we haven't changed the existing execution framework; instead, we've optimized some details. The new changes do not impact the original unit tests, so I believe the risk is manageable. cc: @cnauroth |
Since @cnauroth has also reviewed this, let's merge this. |
…art1. (apache#7371) Co-authored-by: Chris Nauroth <cnauroth@apache.org> Co-authored-by: Tsz-wo Sze <szetszwo@apache.org> Reviewed-by: Chris Nauroth <cnauroth@apache.org> Reviewed-by: Tsz-wo Sze <szetszwo@apache.org> Signed-off-by: Shilun Fan <slfan1989@apache.org>
…art1. (apache#7371) Co-authored-by: Chris Nauroth <cnauroth@apache.org> Co-authored-by: Tsz-wo Sze <szetszwo@apache.org> Reviewed-by: Chris Nauroth <cnauroth@apache.org> Reviewed-by: Tsz-wo Sze <szetszwo@apache.org> Signed-off-by: Shilun Fan <slfan1989@apache.org>
Description of PR
JIRA: HDFS-17719. Upgrade JUnit from 4 to 5 in hadoop-hdfs-httpfs.
How was this patch tested?
Junit Test & mvn clean test.
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?