-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
Having a QuarkusTest
provide config overrides via the TestProfile
annotation pollutes the environment of other tests in the suite.
I was able to debug the QuarkusComponentTestExtension
and inspect the resolved Config
object. Using the org.eclipse.microprofile.config.Config.getConfigValue
API, I was able to see that the incorrect config value was coming from system properties (I assume set by the quarkus test extension).
Expected behavior
I understand the limitation with Quarkus tests and how the Test Profiles work by requiring a test ordering and a restarting of the Quarkus server (which is part of my motivation for wanting to move more of my tests to be QuarkusComponentTest
s rather than QuarkusTest
).
However, it appears the orderer is unaware of QuarkusComponentTest
s. It would seem the server needs to either restart after the last QuarkusTest
with a TestProfile
, or QuarkusComponentTest
s needed to be ordered before QuarkusTest
s. I encountered this issue when my test order changed on a quarkus upgrade. However, this doesn't appear to be associated with any change to the QuarkusTestProfileAwareClassOrderer
.
It's possible to work around this by extending QuarkusTestProfileAwareClassOrderer
and overriding getCustomOrderKey
to detect if the class is annotated with QuarkusComponentTest
. However, if it is a goal to increase the adoption of QuarkusComponentTest
s then I think they should be included in the default ordering
Actual behavior
No response
How to Reproduce?
Reproducer: https://github.com/ryandens/quarkus-component-test-reproducer
- Clone the repository
- Run the build, see the failing
QuarkusComponentTest
(resolving the non-default config value specified in theQuarkusTest
) - Remove the
QuarkusTest
and seeQuarkusComponentTest
now passes. - Optionally, enable the
quarkus.test.class-orderer
commented out. insrc/test/resources/application.properties
to see that changing the order of the test classes fixes this issue
Output of uname -a
or ver
Darwin Mac 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 18:56:34 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6020 arm64
Output of java -version
OpenJDK 64-Bit Server VM Temurin-21.0.6+7 (build 21.0.6+7-LTS, mixed mode, sharing)
Quarkus version or git rev
3.18.1
Build tool (ie. output of mvnw --version
or gradlew --version
)
------------------------------------------------------------ Gradle 8.12.1 ------------------------------------------------------------ Build time: 2025-01-24 12:55:12 UTC Revision: 0b1ee1ff81d1f4a26574ff4a362ac9180852b140 Kotlin: 2.0.21 Groovy: 3.0.22 Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024 Launcher JVM: 21.0.6 (Eclipse Adoptium 21.0.6+7-LTS) Daemon JVM: /Users/ryandens/.sdkman/candidates/java/21.0.6-tem (no JDK specified, using current Java home) OS: Mac OS X 15.2 aarch64
Additional information
No response