Skip to content

Commit e4815d7

Browse files
authored
Merge pull request quarkusio#47759 from geoand/quarkusio#47400
Update profile configuration for integration tests
2 parents 885b2e1 + 555f72c commit e4815d7

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestConfig.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,10 @@ public interface TestConfig {
157157
@WithDefault("false")
158158
boolean flatClassPath();
159159

160-
/**
161-
* The profile to use when testing the native image
162-
*/
163-
@WithDefault("prod")
164-
String nativeImageProfile();
165-
166160
/**
167161
* The profile to use when testing using {@code @QuarkusIntegrationTest}
168162
*/
169-
@WithDefault("prod")
163+
@WithDefault("${quarkus.profile:prod}")
170164
String integrationTestProfile();
171165

172166
/**

test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusIntegrationTestExtension.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ private QuarkusTestExtensionState doProcessStart(Properties quarkusArtifactPrope
232232
// propagate Quarkus properties set from the build tool
233233
Properties existingSysProps = System.getProperties();
234234
for (String name : existingSysProps.stringPropertyNames()) {
235-
if (name.startsWith("quarkus.")) {
235+
if (name.startsWith("quarkus.")
236+
// don't include 'quarkus.profile' as that has already been taken into account when determining the launch profile
237+
// so we don't want this to end up in multiple launch arguments
238+
&& !name.equals("quarkus.profile")) {
236239
additionalProperties.put(name, existingSysProps.getProperty(name));
237240
}
238241
}

test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainIntegrationTestExtension.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ private ArtifactLauncher.LaunchResult doProcessStart(ExtensionContext context, S
144144
// propagate Quarkus properties set from the build tool
145145
Properties existingSysProps = System.getProperties();
146146
for (String name : existingSysProps.stringPropertyNames()) {
147-
if (name.startsWith("quarkus.")) {
147+
if (name.startsWith("quarkus.")
148+
// don't include 'quarkus.profile' as that has already been taken into account when determining the launch profile
149+
// so we don't want this to end up in multiple launch arguments
150+
&& !name.equals("quarkus.profile")) {
148151
additionalProperties.put(name, existingSysProps.getProperty(name));
149152
}
150153
}

test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/DockerContainerLauncherProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ static class DefaultDockerInitContext extends DefaultInitContextBase
155155
private final Map<Integer, Integer> additionalExposedPorts;
156156
private final Optional<String> entryPoint;
157157
private final List<String> programArgs;
158-
private Map<String, String> labels;
159-
private Map<String, String> volumeMounts;
158+
private final Map<String, String> labels;
159+
private final Map<String, String> volumeMounts;
160160

161161
public DefaultDockerInitContext(int httpPort, int httpsPort, Duration waitTime, String testProfile,
162162
List<String> argLine, Map<String, String> env,

test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/NativeImageLauncherProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public NativeImageLauncher create(CreateContext context) {
4545
config.getValue("quarkus.http.test-port", OptionalInt.class).orElse(DEFAULT_PORT),
4646
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
4747
testConfig.waitTime(),
48-
testConfig.nativeImageProfile(),
48+
testConfig.integrationTestProfile(),
4949
TestConfigUtil.argLineValues(testConfig.argLine().orElse("")),
5050
testConfig.env(),
5151
context.devServicesLaunchResult(),

0 commit comments

Comments
 (0)