Skip to content

Commit c1d35cc

Browse files
committed
Consider quarkus.test.arg-line as a string
We don't want to split it on commas but spaces so here is a quick fix for it. We could write a specific converter but I'm not really sure it's worth it. Fixes #45878 (cherry picked from commit 7be5a75)
1 parent a57952a commit c1d35cc

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public interface TestConfig {
185185
* When the artifact is a {@code container}, this string is passed right after the {@code docker run} command.
186186
* When the artifact is a {@code native binary}, this string is passed right after the native binary name.
187187
*/
188-
Optional<@WithConverter(TrimmedStringConverter.class) List<String>> argLine();
188+
Optional<@WithConverter(TrimmedStringConverter.class) String> argLine();
189189

190190
/**
191191
* Additional environment variables to be set in the process that {@code @QuarkusIntegrationTest} launches.

test-framework/common/src/main/java/io/quarkus/test/common/TestConfigUtil.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ public final class TestConfigUtil {
1818
private TestConfigUtil() {
1919
}
2020

21+
public static List<String> argLineValues(String argLine) {
22+
if (argLine == null || argLine.isBlank()) {
23+
return List.of();
24+
}
25+
String[] parts = argLine.split("\\s+");
26+
List<String> result = new ArrayList<>(parts.length);
27+
for (String s : parts) {
28+
String trimmed = s.trim();
29+
if (trimmed.isEmpty()) {
30+
continue;
31+
}
32+
result.add(trimmed);
33+
}
34+
return result;
35+
}
36+
2137
@Deprecated(forRemoval = true, since = "3.17")
2238
public static List<String> argLineValue(Config config) {
2339
String strValue = config.getOptionalValue("quarkus.test.arg-line", String.class)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.quarkus.test.common.ArtifactLauncher;
2626
import io.quarkus.test.common.DefaultDockerContainerLauncher;
2727
import io.quarkus.test.common.DockerContainerArtifactLauncher;
28+
import io.quarkus.test.common.TestConfigUtil;
2829
import io.smallrye.config.SmallRyeConfig;
2930

3031
public class DockerContainerLauncherProvider implements ArtifactLauncherProvider {
@@ -88,7 +89,7 @@ private void launcherInit(CreateContext context, DockerContainerArtifactLauncher
8889
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
8990
testConfig.waitTime(),
9091
testConfig.integrationTestProfile(),
91-
testConfig.argLine().orElse(List.of()),
92+
TestConfigUtil.argLineValues(testConfig.argLine().orElse("")),
9293
testConfig.env(),
9394
context.devServicesLaunchResult(),
9495
containerImage,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.quarkus.test.common.ArtifactLauncher;
1919
import io.quarkus.test.common.DefaultJarLauncher;
2020
import io.quarkus.test.common.JarArtifactLauncher;
21+
import io.quarkus.test.common.TestConfigUtil;
2122
import io.smallrye.config.SmallRyeConfig;
2223

2324
public class JarLauncherProvider implements ArtifactLauncherProvider {
@@ -47,7 +48,7 @@ public JarArtifactLauncher create(CreateContext context) {
4748
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
4849
testConfig.waitTime(),
4950
testConfig.integrationTestProfile(),
50-
testConfig.argLine().orElse(List.of()),
51+
TestConfigUtil.argLineValues(testConfig.argLine().orElse("")),
5152
testConfig.env(),
5253
context.devServicesLaunchResult(),
5354
context.buildOutputDirectory().resolve(pathStr)));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import io.quarkus.test.common.ArtifactLauncher;
1818
import io.quarkus.test.common.DefaultNativeImageLauncher;
1919
import io.quarkus.test.common.NativeImageLauncher;
20+
import io.quarkus.test.common.TestConfigUtil;
2021
import io.smallrye.config.SmallRyeConfig;
2122

2223
public class NativeImageLauncherProvider implements ArtifactLauncherProvider {
@@ -45,7 +46,7 @@ public NativeImageLauncher create(CreateContext context) {
4546
config.getValue("quarkus.http.test-ssl-port", OptionalInt.class).orElse(DEFAULT_HTTPS_PORT),
4647
testConfig.waitTime(),
4748
testConfig.nativeImageProfile(),
48-
testConfig.argLine().orElse(List.of()),
49+
TestConfigUtil.argLineValues(testConfig.argLine().orElse("")),
4950
testConfig.env(),
5051
context.devServicesLaunchResult(),
5152
System.getProperty("native.image.path"),

0 commit comments

Comments
 (0)