Repository navigation
Persisted config source not loading properties at runtime - #12157
Conversation
|
Looks like nexus is unavailable. |
There was a problem hiding this comment.
@pedroigor the fix itself in the codebase LGTM, I wasn't sure if checking for the ClassLoader instance was right at all, wanted to discuss with you. Seems not :)
For the testing enhancements:
- When no additional test dependencies should be added (as per this comment), why you also add 2? Easily achievable using only the Testcontainers library we have, and
GenericContainerwith the appropriate images (ref), but a bit more boilerplate involved (setting DB user, pw etc usingwithEnvor sth), so I thought add the dependency, only for test for sure, to avoid this boilerplate. Feel free to leave them, as it is what I did essentially, it's just that I don't get that comment then ;) - pls incorporate my tests in this PR in order to make it approvable. Looking at your code, you set
dbusingdist.setProperty()so it would be available from non-persistent source in the properties file we generate unless we have aremovePropertythat we don't have or we useReInstall.BEFORE_TESTthat makes no sense.
To make it more concise: This test that I introduced to make sure thedbprop is read from persisted properties would fail with your current PR I guess, bc.dbis actually read from the properties file in the temp kc installation instead of being read from the persisted properties. This would lead to the subsequent tests actually succeeding (see proposed workaround here), but is not the use case we want to test => using a pre-optimized serverimage without thedbset anywhere but in persisted props. - w.r.t. "adding functionality for additional databases": I avoided this to not add unnecessary complexity until it is needed. But when it works, feel free to add it for mariadb, too, but then there's the question why not add it for all DBs? Imo this is a point for an extra ticket or should be incorporated for additional DBs whenever it is needed by a specific use case. My PR introduced "just enough" code to fix the issue. I used postgres bc. it is the only db the operator also supports, and one of the two dbs we want to go with later on as first-class, so imo this should be our go-to db for testing. Also, the problem was not really db-specific, but configuration and build/runtime behaviour specific so one test for one db should suffice w.r.t. test execution 8000 times. That said, when it works, why not..
*hushs back to PTO ;)
Sorry, I meant you don't need to set a version if you have a transient dependency. The way you did will force us to change versions between Quarkus upgrades. Keep in mind that we should leverage dependencies (and versions) from Quarkus as much as possible
I've added the test to check
There is no additional complexity, we are just leveraging the capabilities available from the test suite to also allow bootstrapping a container when running distribution tests. No need to manually create containers within tests but just use the annotation we already have. We should try to enhance the testsuite whenever we have a chance and here we are now able to run tests against the distribution using a database (in a generic way).
Let's talk more once you're back. The latest changes should be enough to introduce your test scenario. |
Closes keycloak#12156 Co-authored-by: Dominik Guhr <dguhr@redhat.com>
There was a problem hiding this comment.
Nice work! Added a few comments
|
Side note: the Operator CI might be fixed by those changes: |
…2157) Co-authored-by: Dominik Guhr <dguhr@redhat.com> Conflicts: .github/workflows/ci.yml quarkus/tests/integration/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java
Closes #12156