Fix the log4j-spring-cloud-config-client test harness - #4317
Open
ramanathan1504 wants to merge 3 commits into
Open
Fix the log4j-spring-cloud-config-client test harness #4317ramanathan1504 wants to merge 3 commits into
ramanathan1504 wants to merge 3 commits into
Conversation
The module has run no tests since `8d706b4b27` (2024-01-04) removed `junit-vintage-engine` while `Log4j2EventListenerTest` stayed on JUnit 4: Surefire selects the JUnit Platform provider, discovers nothing and reports `Tests run: 0` with a green build. Restoring the engine exposes three further breakages that kept the only assertion in the module unreachable: - `CONFIG` named `log4j-console.xml`; the resource is `log4j2-console.xml`. - `spring-boot-starter-log4j2` is a test dependency, so Boot installs its own bundled `log4j2.xml` before `LoggerContextRule` can install the module's. - Neither configuration declares `monitorInterval`, so `AbstractConfiguration.isConfigurationMonitoringEnabled()` is false, `WatchManager.start()` never runs, nothing subscribes to `WatchEventManager` and `publishEvent()` iterates an empty map. `logging.config` now points Boot at the module's own configuration and the test reads the `LoggerContext` that Boot installed, which retires the `LoggerContextRule` and `RuleChain`. `withCleanFilesRule("target/logs")` is dropped with them; the configuration declares a single console appender and has never written there. Verified: `Tests run: 1, Failures: 0` with both halves in place, and `Failures: 1` with either `monitorInterval` or the `logging.config` property removed. Full `verify` on the module is green through spotbugs, RAT, spotless and bnd-baseline.
…-vintage-engine` dependency
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.
Follow-up to @vy's request on #4252. The module has run no tests since removed
junit-vintage-enginewhileLog4j2EventListenerTeststayed on JUnit 4.After Restoring jave some issues:
CONFIGnames a file that does not exist, Boot's bundledlog4j2.xmlclaims theLoggerContextfirst, and no configuration declaresmonitorInterval, soWatchManager.start()never subscribes toWatchEventManager.