Repository navigation
[Testsuite PoC] Adding config to provide option to select supplier types - #31295
wojnarfilip wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Not sure if there is more elegant way to check that file based config was provided with -Dkc.test.config
There was a problem hiding this comment.
After seeing this PR https://github.com/keycloak/keycloak/pull/31292/files. I guess it would be better to do something like this and have static getters right ? @stianst @miquelsi
private static final SmallRyeConfig config;
static {
List<ConfigSource> configSources = new ArrayList<>();
String kcTestConfigPath = System.getProperty("kc.test.config");
if (kcTestConfigPath != null) {
configSources.add(new FileConfigSource());
}
config = new SmallRyeConfigBuilder()
.addDefaultSources()
.addDefaultInterceptors()
.withSources(configSources)
.build();
}
So the config is more global and there isn't need to initialize it.
There was a problem hiding this comment.
8000@wojnarfilip please, rebase to latest change and focus on smallrye support of .env files (out of the box), I would propose to remove this class then: test-poc/framework/src/main/java/org/keycloak/test/framework/config/Config.java
9c45403 to
dc7e4c2
Compare
There was a problem hiding this comment.
Is this needed? Looking at https://smallrye.io/smallrye-config/Main/config/getting-started/ it should already support .env file from the current working directory by default
There was a problem hiding this comment.
This class is for loading of config values from file provided with -Dkc.test.config= as was mentioned in #30608.
There was a problem hiding this comment.
Same with this is it needed?
There was a problem hiding this comment.
At this point probably not. Will remove this.
My thought behind this was that we might implement more ConfigSources specific for Keycloak over time and might want our own interface to be more flexible.
There was a problem hiding this comment.
Would just call this Config or TestConfig, KeycloakSmallryeConfig is longer than it needs to be ;)
|
This may be better done as a follow-up, but wonder how we will support passing CLI options when running tests. The following won't work as Having to wire-up all options in the pom.xml to pass to Surefire is also not very elegant. Perhaps just using environment variables is better: |
There was a problem hiding this comment.
Don't you want to create private static final String testConfig = "kc.test.config" variable in here for better readability?
There was a problem hiding this comment.
@wojnarfilip outer parentheses not required, probably a typo
Signed-off-by: wojnarfilip <fwojnar@redhat.com>
There was a problem hiding this comment.
thanks for your fixes, good job @wojnarfilip, LGTM
|
There's a I did a quick cleanup proposal here: |
|
+1 for the proposed commit by @stianst |
|
Lets go with @stianst commit then, should I close this ? |
|
I think you can just cherry-pick the proposed changes on top of this PR. |
|
Created a PR #31434 - I can squash it on merge |
|
Closing in favor of #31434 |
Default Config Sources and their ordinal can be found there https://smallrye.io/smallrye-config/Main/config/getting-started/.
Closes #30608