DomGarguilo opened a new issue, #5869:
URL: https://github.com/apache/accumulo/issues/5869
This is present in 2.1 and 4.0
Several of the test cases in CompressionTest are not actually running any
test code. The following pattern is common in this test class:
```java
for (final String name : Compression.getSupportedAlgorithms()) {
CompressionAlgorithm al =
Compression.getCompressionAlgorithmByName(name);
if (isSupported.get(al) != null && isSupported.get(al)) {
<test logic>
}
```
This `if (isSupported.get(al) != null && isSupported.get(al))` is causing
the test logic to be completely skipped.
This becomes more evident if we refactor things into the following pattern:
```java
final var supportedAlgos = Compression.getSupportedAlgorithms().stream()
.map(Compression::getCompressionAlgorithmByName)
.filter(algo -> isSupported.get(algo) != null &&
isSupported.get(algo)).toList();
if (supportedAlgos.isEmpty()) {
log.error("There are no supported compression algorithms, skipping
test case");
return;
}
for (final CompressionAlgorithm al : supportedAlgos) {
<test logic>
```
This allows us to consistently see the new log message about tests being
skipped.
I am not familiar with the specifics of these checks or what the expected
results are but I'm pretty sure its intended that some of the test code is run.
This was uncovered during review
[here](https://github.com/apache/accumulo/pull/5853#discussion_r2325173737)
--
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]