From b01c17959e85850c875da52aba9cd6d28153fab6 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 16 Jul 2015 21:45:20 -0400 Subject: [PATCH] fix REPRODUCE WITH for integration tests --- .../junit/listeners/ReproduceInfoPrinter.java | 23 +++++++++++++++---- pom.xml | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java b/core/src/test/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java index e57732bf5f8..d63a0797f26 100644 --- a/core/src/test/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java +++ b/core/src/test/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java @@ -62,6 +62,13 @@ public class ReproduceInfoPrinter extends RunListener { logger.trace("Test {} finished", description.getDisplayName()); } + /** + * true if we are running maven integration tests (mvn verify) + */ + static boolean inVerifyPhase() { + return Boolean.parseBoolean(System.getProperty("tests.verify.phase")); + } + @Override public void testFailure(Failure failure) throws Exception { // Ignore assumptions. @@ -70,7 +77,11 @@ public class ReproduceInfoPrinter extends RunListener { } final StringBuilder b = new StringBuilder(); - b.append("REPRODUCE WITH: mvn test -Pdev"); + if (inVerifyPhase()) { + b.append("REPRODUCE WITH: mvn verify -Pdev -Dskip.unit.tests"); + } else { + b.append("REPRODUCE WITH: mvn test -Pdev"); + } MavenMessageBuilder mavenMessageBuilder = new MavenMessageBuilder(b); mavenMessageBuilder.appendAllOpts(failure.getDescription()); @@ -140,9 +151,13 @@ public class ReproduceInfoPrinter extends RunListener { } public ReproduceErrorMessageBuilder appendESProperties() { - appendProperties("es.logger.level", "es.node.mode", "es.node.local", TESTS_CLUSTER, InternalTestCluster.TESTS_ENABLE_MOCK_MODULES, - "tests.assertion.disabled", "tests.security.manager", "tests.nightly", "tests.jvms", "tests.client.ratio", "tests.heap.size", - "tests.bwc", "tests.bwc.version"); + appendProperties("es.logger.level"); + if (!inVerifyPhase()) { + // these properties only make sense for unit tests + appendProperties("es.node.mode", "es.node.local", TESTS_CLUSTER, InternalTestCluster.TESTS_ENABLE_MOCK_MODULES); + } + appendProperties("tests.assertion.disabled", "tests.security.manager", "tests.nightly", "tests.jvms", + "tests.client.ratio", "tests.heap.size", "tests.bwc", "tests.bwc.version"); if (System.getProperty("tests.jvm.argline") != null && !System.getProperty("tests.jvm.argline").isEmpty()) { appendOpt("tests.jvm.argline", "\"" + System.getProperty("tests.jvm.argline") + "\""); } diff --git a/pom.xml b/pom.xml index 1c95a00c466..307c57a2796 100644 --- a/pom.xml +++ b/pom.xml @@ -731,6 +731,8 @@ true 127.0.0.1:9300 + + true