8000 HADOOP-19426. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-azure-datalake Part2. by slfan1989 · Pull Request #7757 · apache/hadoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

HADOOP-19426. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-azure-datalake Part2. #7757

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

Merged
merged 2 commits into from
Jul 2, 2025

Conversation

slfan1989
Copy link
Contributor
@slfan1989 slfan1989 commented Jun 23, 2025

Description of PR

JIRA: HADOOP-19426. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-azure-datalake Part2.

How was this patch tested?

mvn clean test & junit test.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 8m 14s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 23m 52s trunk passed
+1 💚 compile 0m 18s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 0m 19s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 0m 18s trunk passed
+1 💚 mvnsite 0m 20s trunk passed
+1 💚 javadoc 0m 24s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 20s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 0m 33s trunk passed
+1 💚 shadedclient 21m 18s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 13s the patch passed
+1 💚 compile 0m 13s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 0m 13s the patch passed
+1 💚 compile 0m 12s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 0m 12s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 9s the patch passed
+1 💚 mvnsite 0m 14s the patch passed
+1 💚 javadoc 0m 12s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 13s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 0m 27s the patch passed
+1 💚 shadedclient 20m 8s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 0m 15s /patch-unit-hadoop-tools_hadoop-azure-datalake.txt hadoop-azure-datalake in the patch failed.
+1 💚 asflicense 0m 25s The patch does not generate ASF License warnings.
80m 6s
Subsystem Report/Notes
Docker ClientAPI=1.50 ServerAPI=1.50 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7757/1/artifact/out/Dockerfile
GITHUB PR #7757
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle
uname Linux b1403cff3146 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 0ada4c1
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7757/1/testReport/
Max. process+thread count 544 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure-datalake U: hadoop-tools/hadoop-azure-datalake
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7757/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 20s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 23m 58s trunk passed
+1 💚 compile 0m 20s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 compile 0m 19s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 checkstyle 0m 18s trunk passed
+1 💚 mvnsite 0m 21s trunk passed
+1 💚 javadoc 0m 24s trunk passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 19s trunk passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 0m 31s trunk passed
+1 💚 shadedclient 20m 54s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 13s the patch passed
+1 💚 compile 0m 13s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javac 0m 13s the patch passed
+1 💚 compile 0m 13s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 javac 0m 13s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 9s the patch passed
+1 💚 mvnsite 0m 13s the patch passed
+1 💚 javadoc 0m 13s the patch passed with JDK Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 13s the patch passed with JDK Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
+1 💚 spotbugs 0m 30s the patch passed
+1 💚 shadedclient 20m 30s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 53s hadoop-azure-datalake in the patch passed.
+1 💚 asflicense 0m 26s The patch does not generate ASF License warnings.
73m 2s
Subsystem Report/Notes
Docker ClientAPI=1.50 ServerAPI=1.50 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7757/2/artifact/out/Dockerfile
GITHUB PR #7757
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle
uname Linux e2171ca75097 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / a970a6e
Default Java Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.27+6-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_452-8u452-gaus1-0ubuntu120.04-b09
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7757/2/testReport/
Max. process+thread count 556 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure-datalake U: hadoop-tools/hadoop-azure-datalake
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7757/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor
@zhtttylz zhtttylz left a comment

Choose a reason for hiding this comment

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

+1,LGTM @slfan1989

@slfan1989 slfan1989 requested a review from anujmodi2021 June 23, 2025 08:09
@slfan1989
Copy link
Contributor Author

@anujmodi2021 Could you please help review this PR? Thank you very much!

@slfan1989 slfan1989 requested a review from Copilot June 29, 2025 02:11
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the TestAdlPermissionLive class from JUnit 4 to JUnit 5 parameterized tests and removes the custom Parallelized runner.

  • Converted JUnit 4 annotations and assertions to their JUnit 5 equivalents.
  • Removed the Parallelized helper and switched to @ParameterizedTest with @MethodSource.
  • Updated imports and test setup/cleanup methods to use JUnit 5 APIs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlPermissionLive.java Migrated tests to JUnit 5 parameterized style, replaced annotations and assertions
hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/common/Parallelized.java Removed obsolete JUnit 4 parallel runner helper
Comments suppressed due to low confidence (2)

hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlPermissionLive.java:54

  • [nitpick] The method name initTestAdlPermissionLive is verbose; consider renaming to a more concise name like setupPermissionTest to better reflect its role.
  public void initTestAdlPermissionLive(FsPermission pTestPermission) throws Exception {

hadoop-tools/hadoop-azure-datalake/src/test/java/org/apache/hadoop/fs/adl/live/TestAdlPermissionLive.java:84

  • Consider annotating this setup method with @BeforeEach (JUnit 5) instead of manual invocation in your init helper, to align with JUnit 5 conventions and reduce boilerplate.
  public void setUp() throws Exception {

}

@Parameterized.Parameters(name = "{0}")
public static Collection adlCreateNonRecursiveTestData()
Copy link
Preview
Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

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

Use a parameterized generic return type Collection<FsPermission> for the data provider to avoid raw-type warnings and improve type safety.

Suggested change
public static Collection adlCreateNonRecursiveTestData()
public static Collection<FsPermission[]> adlCreateNonRecursiveTestData()

Copilot uses AI. Check for mistakes.

public static void cleanUp() throws IOException, URISyntaxException {
if (AdlStorageConfiguration.isContractTestEnabled()) {
Assert.assertTrue(AdlStorageConfiguration.createStorageConnector()
assertTrue(AdlStorageConfiguration.createStorageConnector()
.delete(testRoot, true));
Copy link
Preview
Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

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

[nitpick] Add a descriptive message to this assertion to clarify failure context, e.g., assertTrue(..., "Failed to clean up testRoot directory").

Suggested change
.delete(testRoot, true));
.delete(testRoot, true), "Failed to clean up testRoot directory during cleanup.");

Copilot uses AI. Check for mistakes.

Copy link
Contributor
@anujmodi2021 anujmodi2021 left a comment

Choose a reason for hiding this comment

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

+1 LGTM
Just need to check if we need to add @beforeeach and @AfterEach at required places or not

.delete(testRoot, true));
}
}

@Before
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need @beforeeach here after removing @before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anujmodi2021 Thank you for your question! ParameterizedTest in JUnit 5 is a special type of unit test. Unlike JUnit 4, ParameterizedTest requires the initialization of certain parameters directly in the test method, so the setup function is executed at that point. If we add @BeforeEach, the variables in setup would not be initialized yet. Therefore, we don't need to add @BeforeEach; instead, we should call setup within initTestAdlPermissionLive.

@anujmodi2021
Copy link
Contributor

Thanks a lot @slfan1989
+1 from my side. Feel free to merge

@slfan1989 slfan1989 merged commit 950d876 into apache:trunk Jul 2, 2025
4 checks passed
@slfan1989
Copy link
Contributor Author

@anujmodi2021 @zhtttylz Thank you very much for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0