Skip to content

Commit

Permalink
chore(keiko-redis): test logging cleanups (#4775)
Browse files Browse the repository at this point in the history
* chore(keiko-redis/test): add slf4j binding to keiko-redis tests

so test output contains log messages and to avoid these error messages:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.

* chore(keiko-redis-spring/test): add slf4j binding to keiko-redis-spring tests

so test output contains log messages and to avoid these error messages:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

* chore(keiko-redis/test): tone down testcontainers logging

since it's super verbose by default
  • Loading branch information
dbyron-sf authored Aug 28, 2024
1 parent 1d85e7c commit eb61f0e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions keiko-redis-spring/keiko-redis-spring.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ dependencies {
testImplementation "org.assertj:assertj-core"
testImplementation("io.spinnaker.kork:kork-jedis-test")

testRuntimeOnly "ch.qos.logback:logback-classic"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
1 change: 1 addition & 0 deletions keiko-redis/keiko-redis.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies {

testImplementation project(":keiko-tck")
testImplementation "io.spinnaker.kork:kork-jedis-test"
testRuntimeOnly "ch.qos.logback:logback-classic"
}
36 changes: 36 additions & 0 deletions keiko-redis/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
Copyright 2024 Salesforce, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>

<!-- see https://java.testcontainers.org/supported_docker_environment/logging_config/ -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>

<logger name="org.testcontainers" level="INFO"/>
<logger name="tc" level="INFO"/>
<logger name="com.github.dockerjava" level="WARN"/>
<logger name="com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire" level="OFF"/>
<logger name="wiremock.org.eclipse.jetty" level="INFO"/>
</configuration>

0 comments on commit eb61f0e

Please sign in to comment.