Suppress logback status logging in tests#6477
Open
mrdziuban wants to merge 1 commit into
Open
Conversation
Fixes canton-network#5942. digital-asset/canton#535 moved `community/util-observability/src/test/resources/logback-test.xml` to `base/testing-utils/src/main/resources/logback-test.xml`, resulting in `logback-test.xml` being bundled in the `com.daml::testing-utils` JAR file. This conflicts with the `logback-test.xml` in this repo (at `canton/community/util-observability/src/test/resources/logback-test.xml`) and causes logback to log warnings: ``` Resource [logback-test.xml] occurs multiple times on the classpath. Resource [logback-test.xml] occurs at [jar:file:/home/matt/.cache/coursier/v1/https/repo1.maven.org/maven2/com/daml/testing-utils_2.13/3.5.3/testing-utils_2.13-3.5.3.jar!/logback-test.xml] Resource [logback-test.xml] occurs at [file:/home/matt/Projects/splice/canton/community/util-observability/target/scala-2.13/test-classes/logback-test.xml] ``` This adds a `statusListener` of `ch.qos.logback.core.status.NopStatusListener` to the config to suppress the logs, but it doesn't actually fix the issue of there being two `logback-test.xml` files on the classpath. Signed-off-by: Matt Dziuban <mrdziuban@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5942
digital-asset/canton#535 moved
community/util-observability/src/test/resources/logback-test.xmltobase/testing-utils/src/main/resources/logback-test.xml, resulting inlogback-test.xmlbeing bundled in thecom.daml::testing-utilsJAR file. This conflicts with thelogback-test.xmlin this repo (atcanton/community/util-observability/src/test/resources/logback-test.xml) and causes logback to log warnings:This adds a
statusListenerofch.qos.logback.core.status.NopStatusListenerto the config to suppress the logs, but it doesn't actually fix the issue of there being twologback-test.xmlfiles on the classpath.If that's not a sufficient fix, there are a couple other alternatives:
Test / javaOptions += "-Dlogback.configurationFile=.../logback-test.xml"-- this would need to be set on every affected sbt projectlogback-test.xmlin the canton repo tosrc/test/resources(instead ofsrc/main/resources) so it's not bundled in the JAR -- this would then require an update tocom.daml::testing-utilsonce the upstream change is releasedPull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./upgrade_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./lsu_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines