cleanup log filter (#11719)
This commit is contained in:
parent
a3ec307e29
commit
99ab78c146
|
@ -8,6 +8,8 @@ package io.opentelemetry.spring.smoketest;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import io.opentelemetry.api.OpenTelemetry;
|
import io.opentelemetry.api.OpenTelemetry;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -19,6 +21,11 @@ import org.springframework.boot.test.system.OutputCaptureExtension;
|
||||||
@ExtendWith(OutputCaptureExtension.class)
|
@ExtendWith(OutputCaptureExtension.class)
|
||||||
public abstract class AbstractSpringStarterSmokeTest {
|
public abstract class AbstractSpringStarterSmokeTest {
|
||||||
|
|
||||||
|
private static final List<String> IGNORED_WARNINGS =
|
||||||
|
Arrays.asList(
|
||||||
|
"Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider",
|
||||||
|
"The architecture 'amd64' for image");
|
||||||
|
|
||||||
@Autowired protected OpenTelemetry openTelemetry;
|
@Autowired protected OpenTelemetry openTelemetry;
|
||||||
|
|
||||||
protected SpringSmokeTestRunner testing;
|
protected SpringSmokeTestRunner testing;
|
||||||
|
@ -47,11 +54,10 @@ public abstract class AbstractSpringStarterSmokeTest {
|
||||||
// only look for WARN and ERROR log level, e.g. [Test worker] WARN
|
// only look for WARN and ERROR log level, e.g. [Test worker] WARN
|
||||||
.satisfies(
|
.satisfies(
|
||||||
s -> {
|
s -> {
|
||||||
if (!s.toString()
|
for (String line : s.toString().split("\n")) {
|
||||||
.contains(
|
if (IGNORED_WARNINGS.stream().noneMatch(line::contains)) {
|
||||||
"Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider")
|
assertThat(line).doesNotContain("] WARN").doesNotContain("] ERROR");
|
||||||
&& !s.toString().contains("The architecture 'amd64' for image")) {
|
}
|
||||||
assertThat(s).doesNotContain("] WARN").doesNotContain("] ERROR");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue