Copilot commented on code in PR #8190:
URL: https://github.com/apache/hbase/pull/8190#discussion_r3182149016
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotFromClientWithRegionReplicas.java:
##########
@@ -17,18 +17,18 @@
*/
package org.apache.hadoop.hbase.client;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
+import
org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTrackerFactory;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.ClassRule;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.Tag;
-@Category({ LargeTests.class, ClientTests.class })
+@Tag(LargeTests.TAG)
+@Tag(ClientTests.TAG)
public class TestSnapshotFromClientWithRegionReplicas extends
TestSnapshotFromClient {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
-
HBaseClassTestRule.forClass(TestSnapshotFromClientWithRegionReplicas.class);
+ public
TestSnapshotFromClientWithRegionReplicas(StoreFileTrackerFactory.Trackers
trackerImpl) {
+ super(trackerImpl);
Review Comment:
This subclass now relies on the `@TestTemplate` methods inherited from
`TestSnapshotFromClient`, but `@HBaseParameterizedTestTemplate` is not
inherited. Without annotating the concrete subclass as well, Jupiter will not
create any invocations here, so this suite stops running for both tracker
implementations.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobSnapshotFromClient.java:
##########
@@ -18,32 +18,32 @@
package org.apache.hadoop.hbase.client;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.mob.MobConstants;
+import
org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTrackerFactory;
import org.apache.hadoop.hbase.snapshot.MobSnapshotTestingUtils;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
/**
* Test create/using/deleting snapshots from the client
* <p>
* This is an end-to-end test for the snapshot utility
*/
-@Category({ LargeTests.class, ClientTests.class })
+@Tag(LargeTests.TAG)
+@Tag(ClientTests.TAG)
public class TestMobSnapshotFromClient extends TestSnapshotFromClient {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestMobSnapshotFromClient.class);
+ public TestMobSnapshotFromClient(StoreFileTrackerFactory.Trackers
trackerImpl) {
+ super(trackerImpl);
Review Comment:
`TestSnapshotFromClient` provides only `@TestTemplate` tests, and
`@HBaseParameterizedTestTemplate` is not inherited by subclasses. Since this
concrete subclass no longer declares the annotation, Jupiter will not generate
any invocations here, so the mob snapshot client suite stops executing.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSeparateClientZKCluster.java:
##########
@@ -93,14 +88,14 @@ public static void beforeAllTests() throws Exception {
TEST_UTIL.startMiniCluster(option);
}
- @AfterClass
+ @AfterAll
public static void afterAllTests() throws Exception {
TEST_UTIL.shutdownMiniCluster();
clientZkCluster.shutdown();
FileUtils.deleteDirectory(clientZkDir);
}
- @Before
+ @BeforeEach
public void setUp() throws IOException {
Review Comment:
After switching this class to JUnit 5 lifecycle/test annotations, the JUnit
4 `TableNameTestRule` is no longer executed. `name.getTableName()` is still
used by several tests in this class, so it will stay null and those tests will
fail when they try to build or access a table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]