Skip to content

Commit

Permalink
Introduce proper property name for controlling IT profile
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Dec 13, 2022
1 parent 0a79d6a commit 15a6632
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* <p>
* TODO refactor code to actually use these values
*/
@SuppressWarnings("jol")
@ConfigRoot
public class TestConfig {

Expand Down Expand Up @@ -149,6 +150,12 @@ public class TestConfig {
@ConfigItem(defaultValue = "prod")
String nativeImageProfile;

/**
* The profile to use when testing using {@code @QuarkusIntegrationTest}
*/
@ConfigItem(defaultValue = "prod")
String integrationTestProfile;

/**
* Profile related test settings
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ public static Duration waitTimeValue(Config config) {
.orElseGet(() -> config.getOptionalValue("quarkus.test.jar-wait-time", Duration.class) // legacy value
.orElseGet(() -> Duration.ofSeconds(DEFAULT_WAIT_TIME_SECONDS)));
}

public static String integrationTestProfile(Config config) {
return config.getOptionalValue("quarkus.test.integration-test-profile", String.class)
.orElseGet(() -> config.getOptionalValue("quarkus.test.native-image-profile", String.class)
.orElse(null));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public DockerContainerArtifactLauncher create(CreateContext context) {
config.getValue("quarkus.http.test-port", OptionalInt.class).orElse(DEFAULT_PORT),
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
ConfigUtil.waitTimeValue(config),
config.getOptionalValue("quarkus.test.native-image-profile", String.class).orElse(null),
ConfigUtil.integrationTestProfile(config),
ConfigUtil.argLineValue(config),
context.devServicesLaunchResult(),
containerImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public JarArtifactLauncher create(CreateContext context) {
config.getValue("quarkus.http.test-port", OptionalInt.class).orElse(DEFAULT_PORT),
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
ConfigUtil.waitTimeValue(config),
config.getOptionalValue("quarkus.test.native-image-profile", String.class).orElse(null),
ConfigUtil.integrationTestProfile(config),
ConfigUtil.argLineValue(config),
context.devServicesLaunchResult(),
context.buildOutputDirectory().resolve(pathStr)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public NativeImageLauncher create(CreateContext context) {
config.getValue("quarkus.http.test-port", OptionalInt.class).orElse(DEFAULT_PORT),
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
ConfigUtil.waitTimeValue(config),
config.getOptionalValue("quarkus.test.native-image-profile", String.class).orElse(null),
ConfigUtil.integrationTestProfile(config),
ConfigUtil.argLineValue(config),
context.devServicesLaunchResult(),
System.getProperty("native.image.path"),
Expand Down

0 comments on commit 15a6632

Please sign in to comment.