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

QuarkusComponentTest: make is possible to specify priority of a test config property #35199

Closed
mkouba opened this issue Aug 4, 2023 · 2 comments · Fixed by #35202
Closed
Assignees
Labels
area/testing kind/enhancement New feature or request
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Aug 4, 2023

Description

So that it can be used to override system properties and ENV variables.

Implementation ideas

We could either make the ordinal of the QuarkusComponentTest config source configurable (i.e. all test config properties will have the same priority) or extend the API like @TestConfigProperty(key = "foo", value = "bar", ordinal = 100) (ordinal corresponds to the org.eclipse.microprofile.config.spi.ConfigSource.getOrdinal()). The latter is more flexible but also more verbose.

@mkouba mkouba added kind/enhancement New feature or request area/testing labels Aug 4, 2023
@mkouba mkouba self-assigned this Aug 4, 2023
@mkouba
Copy link
Contributor Author

mkouba commented Aug 4, 2023

Keep in mind that io.quarkus.test.junit.QuarkusTestProfile.getConfigOverrides() is implemented as "restorable system properties" which means that if a profile overrides a config property it's currently not possible to override this property with @TestConfigProperty.

@mkouba
Copy link
Contributor Author

mkouba commented Aug 4, 2023

The more I think about this the more I believe that we should change the default ordinal to something like 500 so that the test config properties take precedence over system properties and ENV variables...

mkouba added a commit to mkouba/quarkus that referenced this issue Aug 4, 2023
- change the default value to 500 so that test config properties take
predence over system properties, ENV variables and
application.properties
- make the ordinal configurable
- fixes quarkusio#35199
mkouba added a commit to mkouba/quarkus that referenced this issue Aug 7, 2023
- change the default value to 500 so that test config properties take
predence over system properties, ENV variables and
application.properties
- make the ordinal configurable
- fixes quarkusio#35199
@quarkus-bot quarkus-bot bot added this to the 3.3 - main milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant