Copilot commented on code in PR #8169:
URL: https://github.com/apache/hbase/pull/8169#discussion_r3162630470
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java:
##########
@@ -18,18 +18,20 @@
package org.apache.hadoop.hbase.wal;
import java.util.stream.Stream;
-import org.apache.hadoop.hbase.HBaseParameterizedTestTemplate;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
Review Comment:
Same issue as in `TestCompressedWALValueCompression`: JUnit Jupiter doesn't
support this class-level parameterization API in its standard params module. To
keep the test running per provider value, use a supported mechanism (retain the
prior HBase parameterized test template, or refactor to method-level
`@ParameterizedTest` + `@MethodSource`).
##########
hbase-compression/hbase-compression-zstd/src/test/java/org/apache/hadoop/hbase/io/compress/zstd/TestHFileCompressionZstd.java:
##########
@@ -86,7 +81,6 @@ public void testReconfLevels() throws Exception {
long len_2 = FS.getFileStatus(path_2).getLen();
LOG.info("Level 1 len {}", len_1);
LOG.info("Level 22 len {}", len_2);
- assertTrue("Reconfiguraton with ZSTD_LEVEL_KEY did not seem to work",
len_1 > len_2);
+ assertTrue(len_1 > len_2, "Reconfiguraton with ZSTD_LEVEL_KEY did not seem
to work");
Review Comment:
Fix typo in assertion message: 'Reconfiguraton' should be 'Reconfiguration'.
```suggestion
assertTrue(len_1 > len_2, "Reconfiguration with ZSTD_LEVEL_KEY did not
seem to work");
```
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/CompressedWALTestBase.java:
##########
@@ -71,12 +68,12 @@ public abstract class CompressedWALTestBase {
Arrays.fill(VALUE, off, (off += 1597), (byte) 'Q');
}
- @TestTemplate
+ @Test
public void test() throws Exception {
testForSize(1000);
}
- @TestTemplate
+ @Test
public void testLarge() throws Exception {
testForSize(1024 * 1024);
}
Review Comment:
These methods were previously `@TestTemplate`, which allows repeated
execution under a template/parameterization extension. Converting them to plain
`@Test` will run each only once per subclass instance and will not
automatically iterate over compression/provider parameters. If the intent is to
execute `test()`/`testLarge()` for each parameter set, revert these back to
`@TestTemplate` (with the appropriate template extension/annotation) or move to
supported JUnit parameterized methods (method-level `@ParameterizedTest`) so
the parameter matrix is preserved.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java:
##########
@@ -18,18 +18,20 @@
package org.apache.hadoop.hbase.wal;
import java.util.stream.Stream;
-import org.apache.hadoop.hbase.HBaseParameterizedTestTemplate;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
@Tag(RegionServerTests.TAG)
@Tag(MediumTests.TAG)
-@HBaseParameterizedTestTemplate(name = "{index}: provider={0}")
+@ParameterizedClass(name = "{index}: provider={0}")
+@MethodSource("parameters")
Review Comment:
Same issue as in `TestCompressedWALValueCompression`: JUnit Jupiter doesn't
support this class-level parameterization API in its standard params module. To
keep the test running per provider value, use a supported mechanism (retain the
prior HBase parameterized test template, or refactor to method-level
`@ParameterizedTest` + `@MethodSource`).
--
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]