Skip to content

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

@mikethecalamity

Description

@mikethecalamity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions