Skip to content

Commit 11af839

Browse files
Use single quotes in reproduction command (#18533) (#18539)
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. (cherry picked from commit 225b0f8) Signed-off-by: Andrew Ross <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 894d159 commit 11af839

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
@@ -92,20 +92,20 @@ public void testFailure(Failure failure) throws Exception {
9292

9393
// append Gradle test runner test filter string
9494
b.append("'" + task + "'");
95-
b.append(" --tests \"");
95+
b.append(" --tests '");
9696
b.append(failure.getDescription().getClassName());
9797
final String methodName = failure.getDescription().getMethodName();
9898
if (methodName != null) {
9999
// fallback to system property filter when tests contain "."
100100
if (methodName.contains(".")) {
101-
b.append("\" -Dtests.method=\"");
101+
b.append("' -Dtests.method='");
102102
b.append(methodName);
103103
} else {
104104
b.append(".");
105105
b.append(methodName);
106106
}
107107
}
108-
b.append("\"");
108+
b.append("'");
109109

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

0 commit comments

Comments
 (0)