HBASE-30190 Upgrade hbase-server to use junit5 Part21 - #8301
Conversation
There was a problem hiding this comment.
Pull request overview
Part 21 of the migration of hbase-server tests from JUnit 4 to JUnit 5. The PR converts replication-related tests under org.apache.hadoop.hbase.replication to use JUnit Jupiter APIs (@Tag, @BeforeAll/@AfterAll/@BeforeEach/@AfterEach, Assertions.*, @HBaseParameterizedTestTemplate, TableNameTestExtension), removes @ClassRule HBaseClassTestRule, and reshapes some base classes so that subclasses can override the @BeforeAll/@AfterAll lifecycle (e.g. TestReplicationBaseNoBeforeAll, SyncReplicationTestBaseNoBeforeAll). A couple of test files are also moved into the replication package, and assertion argument order is updated to JUnit 5 (expected, actual, message).
Changes:
- Migrate replication tests/base classes from JUnit 4 to JUnit 5 (annotations, assertions, parameterization, table-name extension).
- Split lifecycle: subclasses that need different
@BeforeAllsetup now extend*NoBeforeAllbase classes and callconfigureClusters/startClustersdirectly. - Move
TestBulkLoadReplicationandTestBulkLoadReplicationHFileRefsinto thereplicationpackage and replaceTemporaryFolderwith manually-created random dirs.
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| TestVerifyCellsReplicationEndpoint.java | JUnit5 migration |
| TestSyncReplicationStandby*.java, TestSyncReplicationActive*.java, TestSyncReplicationRemoveRemoteWAL.java, TestSyncReplicationNewRSJoinBetweenRefreshes.java, TestSyncReplicationMoreLogs*.java | JUnit5 migration, use startClusters()/NoBeforeAll bases |
| TestSyncReplicationActiveFSHLog.java | Migration; still contains stale @Category |
| TestSerial*.java, TestBidirectionSerialReplicationStuck.java, TestAddToSerialReplicationPeer.java, TestRemoveFromSerialReplicationPeer.java, SerialReplicationTestBase.java | JUnit5 migration; switch to TableNameTestExtension |
| TestReplicationWith*.java, TestReplicationStatus*.java, TestReplicationStuck*.java, TestReplicationOffsetUtil.java, TestReplicationMetricsforUI.java, TestReplicationKillSlaveRS.java, TestReplicationEmptyWALRecovery.java, TestReplicationEditsDropped*.java, TestReplicationDisableInactivePeer.java, TestReplicationChangingPeerRegionservers.java, TestReplicationProcedureRetry.java, TestReplicationBase*.java | JUnit5 migration |
| TestReplicationSmallTests*.java | Parameterized → @HBaseParameterizedTestTemplate; one assertion arg order regression |
| TestReplicationWALEntryFilters.java | Migration; rename helper assertEquals → assertEntryEquals to avoid clashing with static import |
| TestRemovePeerProcedureWaitForSCP.java, TestClaimReplicationQueue.java | Switched to TestReplicationBaseNoBeforeAll; lifecycle split into @BeforeEach/@AfterEach |
| TestPerTableCFReplication.java, TestNamespaceReplication*.java, TestMultiSlaveReplication.java, TestMigrateRepliationPeerStorageOnline.java, TestMasterReplication.java, TestHBaseReplicationEndpoint.java, TestNonHBaseReplicationEndpoint.java, TestEdits*.java | JUnit5 migration |
| TestBulkLoadReplication.java, TestBulkLoadReplicationHFileRefs.java | Moved to replication package; switched to TestReplicationBaseNoBeforeAll, removed TemporaryFolder |
| SyncReplicationTestBase*.java, SyncReplicationActiveTestBase.java, SyncReplicationStandbyTestBase.java, ReplicationDroppedTablesTestBase.java | Base class refactors for JUnit5 |
| VerifyReplicationTestBase.java | Minor cleanup |
| TableNameTestExtension.java | Add getTableName(String suffix) helper |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Xiao Liu <liuxiaocs@apache.org> (cherry picked from commit 8464d77)
(cherry picked from commit 8464d77) Signed-off-by: Xiao Liu <liuxiaocs@apache.org>
No description provided.