Skip to content

Conversation

@adoroszlai
Copy link
Contributor

@adoroszlai adoroszlai commented Jan 18, 2024

What changes were proposed in this pull request?

Remove dependency on JUnit4.

Some modules still get JUnit4 as a transitive dependency (required by third-party libraries), so keep banning the import of JUnit4 classes. The ban now applies to all Ozone modules.

Remove JUnit4-specific items we no longer need:

  • JUnit5's runner for JUnit4 tests (junit-vintage-engine)
  • custom timeout rule (JUnit5AwareTimeout) added in HDDS-9361
  • checkstyle rule that instructed developers to use JUnit5AwareTimeout
  • allow.junit4 property, used to selectively disallow JUnit4 as we progressed with the migration

Tweaked banned imports:

  • allow org.junit.platform, which is from JUnit5
  • ban MiniDFSCluster (mini cluster from Hadoop); it was used accidentally by TestVolumeSet for some utility method (removed by using @TempDir)
  • ban some test utils from Hadoop for which Ozone has alternative

There were two executions of maven-enforcer-plugin:

  • banned-rocksdb-imports intended to restrict RocksDB classes, but got extended over time with other restrictions; this is overridden (relaxed) in rocksdb-checkpoint-differ
  • ban-junit4-imports restricted JUnit4 classes
    This PR moves non-RocksDB restrictions to the second execution (to apply them in rocksdb-checkpoint-differ, too). The execution is renamed to ban-imports since it's now more generic.

Mention the source of original MetricsAsserts code in javadoc comment, as suggested by @kerneltime in #5987.

https://issues.apache.org/jira/browse/HDDS-9506

How was this patch tested?

CI:
https://github.com/adoroszlai/ozone/actions/runs/7563582590

@adoroszlai adoroszlai self-assigned this Jan 18, 2024
@adoroszlai adoroszlai added build Pull request that modifies the build process dependencies Pull requests that update a dependency file and removed build Pull request that modifies the build process labels Jan 18, 2024
Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the patch.

LGTM.

Also thanks for driving the whole JUnit migration and finally seeing it to completion.

Copy link
Member

@kaijchen kaijchen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @adoroszlai.

@adoroszlai adoroszlai merged commit 10a1dbf into apache:master Jan 19, 2024
@adoroszlai adoroszlai deleted the HDDS-9506 branch January 19, 2024 09:18
@adoroszlai
Copy link
Contributor Author

Thanks @hemantk-12, @kaijchen for the review.

Tejaskriya pushed a commit to Tejaskriya/ozone that referenced this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants