-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Register a Config instance to bootstrap tests #42715
Conversation
3f68dd5
to
8505fd2
Compare
3bba3cb
to
158d6a4
Compare
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Unless there are any objects today, I am going to merge this tomorrow as it really cleans up things |
Oh, even better! Thanks for thinking about that interaction. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Can we rebase this to see if the CI issue persists? |
Yes, done! |
🙏 |
Status for workflow
|
Status for workflow
|
The goal of this PR is to bootstrap a
Config
instance very early in the testing process so it can be used in testing setup code, like in JUnit Extensions and listeners.There is a new module called
quarkus-junit5-config
, replacingquarkus-junit5-properties
. Right now, it is limited, but it can be expanded to support many of the JUnit configurations using our mechanisms.We register the
Config
in the test classloader with a JUnitLauncherSessionListener
. A call toConfigProvider.getConfig
can either return the test config or the Quarkus config, depending on the classloader. It is now consistent, whereas before, it could depend on where it was called (becauseConfigProvider.getConfig
would also create the config if unavailable).Our config is now more tightly integrated with JUnit, so we don't require JUnit properties file to configure the
QuarkusTestProfileAwareClassOrderer
. We add a global JUnitClassOrderer
that can delegate to any otherClassOrderer
provided by the Quarkus configuration.We also redid the logging configuration on test. Since we now have a reliable configuration, there is no need to juggle the config as we did in
BasicLoggingEnabler
, and there is a simpleLoggingSetupExtension
that sets up the log.Since config is more consistent with the testing code, we could remove many of the workarounds we had. For example:
There are still more workarounds spread through the code that we can remove after.
quarkus.test.profile.tags
#35693Breaking Changes:
ClassOrderer
, if a user wanted to supply its own, it would require to excludeio.quarkus:quarkus-junit5-properties
from the test dependencies and provide ajunit-platform.properties
with the propertyjunit.jupiter.testclass.order.default
and FQN of the ordered as value. With this PR, the user only has to provide the orderer's FQN inquarkus.test.class-orderer
.