Skip to content

Commit

Permalink
test: silence migration loggers in tests (#612)
Browse files Browse the repository at this point in the history
tests: silent migration logs in tests
  • Loading branch information
patlo-iog authored Aug 3, 2023
1 parent d8258ee commit 4fb1ca7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions connect/lib/sql-doobie/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
<appender-ref ref="STDOUT"/>
</appender>

<logger name="io.getquill" level="OFF"/>
<logger name="com.zaxxer.hikari" level="OFF"/>

<root level="INFO">
<!--
INFO level is too noisy because of flyway migration log when running "sbt test".
If root level set to INFO, we should also set flyway logLevel to WARN
-->
<root level="WARN">
<appender-ref ref="ASYNCSTDOUT"/>
</root>

</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ object JdbcConnectionRepositorySpec extends ZIOSpecDefault {
) @@ TestAspect.sequential @@ TestAspect.before(
ZIO.serviceWithZIO[Migrations](_.migrate)
)).provide(testEnvironmentLayer)
.provide(Runtime.removeDefaultLoggers)
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ object JdbcCredentialRepositorySpec extends ZIOSpecDefault {
) @@ TestAspect.before(
ZIO.serviceWithZIO[Migrations](_.migrate)
)).provide(testEnvironmentLayer)
.provide(Runtime.removeDefaultLoggers)

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ object JdbcPresentationRepositorySpec extends ZIOSpecDefault {
) @@ TestAspect.before(
ZIO.serviceWithZIO[Migrations](_.migrate)
)).provide(testEnvironmentLayer)
.provide(Runtime.removeDefaultLoggers)

}
8 changes: 6 additions & 2 deletions prism-agent/service/server/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
<logger name="io.getquill" level="OFF"/>
<logger name="com.zaxxer.hikari" level="OFF"/>

<root level="INFO">
<!--
INFO level is too noisy because of flyway migration log when running "sbt test".
If root level set to INFO, we should also set flyway logLevel to WARN
-->
<root level="WARN">
<appender-ref ref="ASYNCSTDOUT"/>
</root>

</configuration>
</configuration>

0 comments on commit 4fb1ca7

Please sign in to comment.