Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.7+ - Tests no longer respect log4j2.xml #25269

Closed
mikethecalamity opened this issue Apr 29, 2022 · 2 comments
Closed

2.7+ - Tests no longer respect log4j2.xml #25269

mikethecalamity opened this issue Apr 29, 2022 · 2 comments
Labels
kind/bug Something isn't working

Comments

@mikethecalamity
Copy link

mikethecalamity commented Apr 29, 2022

Describe the bug

I have a log4j2.xml in the src/test/resources to turn on debug logging during JUnit tests to ensure all code paths are executed. When I try to upgrade to Quarkus 2.7 or higher (I've tried with 2.8.2.Final also), the tests are no longer run with debug logging. This is evident via the jacoco task showing all lines are no longer covered.

Is there a new way I should be going about enabling debug logging during JUnit tests?

Expected behavior

Successful jacocoTestCoverageVerification task (all lines are covered)

Actual behavior

Jacoco failure: lines covered ratio is 0.9, but expected minimum is 1.0

How to Reproduce?

Reproducer: service1 in https://github.com/mweber03/quarkus-test

  1. ./gradlew service1:build
  2. ./gradlew service1:jacocoTestCoverageVerification (succeeds)
  3. Change Quarkus version in gradle.properties to 2.7 or higher
  4. Repeat steps 1 and 2 (fails due to code coverage)

Output of uname -a or ver

Ubuntu 20.04

Output of java -version

OpenJDK 11.0.11

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.5, 2.8.2

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.4.2

Additional information

No response

@mikethecalamity mikethecalamity added the kind/bug Something isn't working label Apr 29, 2022
@mikethecalamity mikethecalamity changed the title 2.7+ - Tests no longer respects log4j.xml 2.7+ - Tests no longer respects log4j2.xml Apr 30, 2022
@mikethecalamity mikethecalamity changed the title 2.7+ - Tests no longer respects log4j2.xml 2.7+ - Tests no longer respect log4j2.xml Apr 30, 2022
@mikethecalamity
Copy link
Author

@gsmet @radcortez ?

@mikethecalamity
Copy link
Author

got it to work by adding an application.properties to src/test/resources containing: %test.quarkus.log.level=DEBUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant