Copilot commented on code in PR #8022:
URL: https://github.com/apache/hbase/pull/8022#discussion_r3031828690
##########
hbase-mapreduce/pom.xml:
##########
@@ -215,11 +215,6 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
Review Comment:
With the removal of the vintage engine, this module still pulls in
`hbase-server` test-jar classes (e.g., `TestReplicationBase`) that reference
JUnit4 types (`org.junit.*` annotations/asserts). There is no explicit JUnit4
API dependency here, so tests can fail at runtime with missing `org.junit.*`
classes. Add an explicit `junit:junit` (JUnit4 API) test-scope dependency
(without vintage) or remove JUnit4 references from the shared test base classes
used by this module.
```suggestion
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
```
##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALInputFormat.java:
##########
@@ -17,27 +17,31 @@
*/
package org.apache.hadoop.hbase.mapreduce;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.LocatedFileStatus;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.testclassification.MapReduceTests;
-import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
-@Category({ MapReduceTests.class, SmallTests.class })
+@Tag(MapReduceTests.TAG)
+@Tag(MediumTests.TAG)
public class TestWALInputFormat {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestWALInputFormat.class);
+ private static final HBaseTestingUtility TEST_UTIL = new
HBaseTestingUtility();
+
+ @BeforeAll
+ public static void setupClass() throws Exception {
+ TEST_UTIL.startMiniCluster();
+ TEST_UTIL.createWALRootDir();
+ }
Review Comment:
`@Tag(MediumTests.TAG)` is used but `MediumTests` is neither imported nor in
this class’s previous classification (it imported `SmallTests`). This will not
compile. Either change the tag to `SmallTests.TAG` or add the correct
`MediumTests` import and update the intent consistently.
--
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]