Skip to content

Commit 225b0f8

Browse files
authored
Use single quotes in reproduction command (#18533)
Parameterized tests will output test names that include double quotes in the test case, such as: ``` ./gradlew ':server:internalClusterTest' --tests "org.opensearch.recovery.RecoveryWhileUnderLoadIT" -Dtests.method="testRecoverWhileUnderLoadWithDerivedSource {p0={"cluster.indices.replication.strategy":"SEGMENT"}}" ``` The nested double quotes do not work appropriately when trying to run the command. This avoids that problem by using single quotes. Signed-off-by: Andrew Ross <[email protected]>
1 parent fe3f454 commit 225b0f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ public void testFailure(Failure failure) throws Exception {
9393

9494
// append Gradle test runner test filter string
9595
b.append("'" + task + "'");
96-
b.append(" --tests \"");
96+
b.append(" --tests '");
9797
b.append(failure.getDescription().getClassName());
9898
final String methodName = failure.getDescription().getMethodName();
9999
if (methodName != null) {
100100
// fallback to system property filter when tests contain "."
101101
if (methodName.contains(".")) {
102-
b.append("\" -Dtests.method=\"");
102+
b.append("' -Dtests.method='");
103103
b.append(methodName);
104104
} else {
105105
b.append(".");
106106
b.append(methodName);
107107
}
108108
}
109-
b.append("\"");
109+
b.append("'");
110110

111111
GradleMessageBuilder gradleMessageBuilder = new GradleMessageBuilder(b);
112112
gradleMessageBuilder.appendAllOpts(failure.getDescription());

0 commit comments

Comments
 (0)