Copilot commented on code in PR #8166:
URL: https://github.com/apache/hbase/pull/8166#discussion_r3162618121
##########
hbase-compression/hbase-compression-zstd/src/test/java/org/apache/hadoop/hbase/io/compress/zstd/TestHFileCompressionZstd.java:
##########
@@ -86,7 +80,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:
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/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:
`@MethodSource` from `org.junit.jupiter.params.provider` does not support
being placed on a class (it targets methods), so this usage will not compile.
If the intent is to run the inherited tests for each provider value, use a
supported JUnit 5 pattern (e.g., `@TestTemplate` + custom invocation context
provider, or convert the inherited tests into `@ParameterizedTest` methods)
rather than a class-level `@MethodSource`.
##########
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:
Replacing `@TestTemplate` with `@Test` changes execution semantics: these
base-class tests will no longer be invoked via a template/parameterized
invocation mechanism. Given the subclasses previously used
`HBaseParameterizedTestTemplate`, this likely reduces coverage (e.g., only a
single execution instead of one per codec/provider) or breaks how parameters
are injected. Consider restoring `@TestTemplate` here (and migrating the
invocation context provider to JUnit 5), or moving parameterization to the
individual test methods using `@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]