quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

DevServices and QuarkusTestResourceLifecycleManager see different LaunchMode value in Continuous Testing mode #19622

Closed sberyozkin closed 3 years ago

sberyozkin commented 3 years ago

Describe the bug

LaunchMode.TEST is reported as LaunchMode.current() in the DevServices processor code (ex, KeycloakDevServicesProcessor) while LaunchMode.NORMAL is seen in QuarkusTestResourceLifecycleManager after starting Quarkus with quarkus:dev and pressing r to run the tests.

I've noticed it when trying to fix #19608 - I'd like to make sure that when a test container is started by DevServices for Keycloak after r is pressed (in addition to the one it starts for the dev services work) then the tests typed to use KeycloakTestResourceLifecycleManager reuse that test container

CC @stuartwdouglas

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

quarkus-bot[bot] commented 3 years ago

/cc @stuartwdouglas

stuartwdouglas commented 3 years ago

QuarkusTestResourceLifecycleManager is run before Quarkus starts, so Quarkus has not had a chance to set the launch mode.

That said given that this is only used in testing I don't think this is a bug, as you already know the launch mode is test.