Clarify reproduce info on Windows

This commit correct the test failure reproduction line on Windows.

Relates #28104
This commit is contained in:
Jason Tedor 2018-01-06 22:44:43 -05:00
parent 8b0b0c36d3
commit eaa636d4bb
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package org.elasticsearch.gradle.vagrant
import com.carrotsearch.gradle.junit4.RandomizedTestingPlugin
import org.apache.tools.ant.taskdefs.condition.Os
import org.elasticsearch.gradle.FileContentsTask
import org.gradle.api.*
import org.gradle.api.artifacts.dsl.RepositoryHandler
@ -343,8 +344,9 @@ class VagrantTestPlugin implements Plugin<Project> {
TaskExecutionAdapter packagingReproListener = new TaskExecutionAdapter() {
@Override
void afterExecute(Task task, TaskState state) {
final String gradlew = Os.isFamily(Os.FAMILY_WINDOWS) ? "gradlew" : "./gradlew"
if (state.failure != null) {
println "REPRODUCE WITH: ./gradlew ${packaging.path} " +
println "REPRODUCE WITH: ${gradlew} ${packaging.path} " +
"-Dtests.seed=${project.testSeed} "
}
}

View File

@ -20,6 +20,7 @@ package org.elasticsearch.test.junit.listeners;
import com.carrotsearch.randomizedtesting.ReproduceErrorMessageBuilder;
import org.apache.logging.log4j.Logger;
import org.apache.lucene.util.Constants;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.test.ESIntegTestCase;
@ -71,7 +72,8 @@ public class ReproduceInfoPrinter extends RunListener {
return;
}
final StringBuilder b = new StringBuilder("REPRODUCE WITH: ./gradlew ");
final String gradlew = Constants.WINDOWS ? "gradlew" : "./gradlew";
final StringBuilder b = new StringBuilder("REPRODUCE WITH: " + gradlew + " ");
String task = System.getProperty("tests.task");
// TODO: enforce (intellij still runs the runner?) or use default "test" but that won't work for integ
b.append(task);