Skip to content

Commit

Permalink
Clarify reproduce info on Windows
Browse files Browse the repository at this point in the history
This commit correct the test failure reproduction line on Windows.

Relates #28104
  • Loading branch information
jasontedor committed Jan 7, 2018
1 parent d4f18c8 commit 32674ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package org.elasticsearch.gradle.vagrant

import org.apache.tools.ant.taskdefs.condition.Os
import org.elasticsearch.gradle.FileContentsTask
import org.gradle.api.*
import org.gradle.api.GradleException
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.execution.TaskExecutionAdapter
import org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency
Expand Down Expand Up @@ -356,8 +361,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.extensions.esvagrant.formattedTestSeed} "
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

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;
Expand Down Expand Up @@ -72,7 +73,8 @@ public void testFailure(Failure failure) throws Exception {
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);
Expand Down

0 comments on commit 32674ef

Please sign in to comment.