Merge pull request #12303 from rmuir/verify-reproduce-with
fix REPRODUCE WITH for integration tests
This commit is contained in:
commit
dc8e3ed483
|
@ -62,6 +62,13 @@ public class ReproduceInfoPrinter extends RunListener {
|
||||||
logger.trace("Test {} finished", description.getDisplayName());
|
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
|
@Override
|
||||||
public void testFailure(Failure failure) throws Exception {
|
public void testFailure(Failure failure) throws Exception {
|
||||||
// Ignore assumptions.
|
// Ignore assumptions.
|
||||||
|
@ -70,7 +77,11 @@ public class ReproduceInfoPrinter extends RunListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder b = new StringBuilder();
|
final StringBuilder b = new StringBuilder();
|
||||||
|
if (inVerifyPhase()) {
|
||||||
|
b.append("REPRODUCE WITH: mvn verify -Pdev -Dskip.unit.tests");
|
||||||
|
} else {
|
||||||
b.append("REPRODUCE WITH: mvn test -Pdev");
|
b.append("REPRODUCE WITH: mvn test -Pdev");
|
||||||
|
}
|
||||||
MavenMessageBuilder mavenMessageBuilder = new MavenMessageBuilder(b);
|
MavenMessageBuilder mavenMessageBuilder = new MavenMessageBuilder(b);
|
||||||
mavenMessageBuilder.appendAllOpts(failure.getDescription());
|
mavenMessageBuilder.appendAllOpts(failure.getDescription());
|
||||||
|
|
||||||
|
@ -140,9 +151,13 @@ public class ReproduceInfoPrinter extends RunListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReproduceErrorMessageBuilder appendESProperties() {
|
public ReproduceErrorMessageBuilder appendESProperties() {
|
||||||
appendProperties("es.logger.level", "es.node.mode", "es.node.local", TESTS_CLUSTER, InternalTestCluster.TESTS_ENABLE_MOCK_MODULES,
|
appendProperties("es.logger.level");
|
||||||
"tests.assertion.disabled", "tests.security.manager", "tests.nightly", "tests.jvms", "tests.client.ratio", "tests.heap.size",
|
if (!inVerifyPhase()) {
|
||||||
"tests.bwc", "tests.bwc.version");
|
// 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()) {
|
if (System.getProperty("tests.jvm.argline") != null && !System.getProperty("tests.jvm.argline").isEmpty()) {
|
||||||
appendOpt("tests.jvm.argline", "\"" + System.getProperty("tests.jvm.argline") + "\"");
|
appendOpt("tests.jvm.argline", "\"" + System.getProperty("tests.jvm.argline") + "\"");
|
||||||
}
|
}
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -731,6 +731,8 @@
|
||||||
<tests.slow>true</tests.slow>
|
<tests.slow>true</tests.slow>
|
||||||
<!-- use external cluster -->
|
<!-- use external cluster -->
|
||||||
<tests.cluster>127.0.0.1:9300</tests.cluster>
|
<tests.cluster>127.0.0.1:9300</tests.cluster>
|
||||||
|
<!-- let framework know we are running integ tests, for correct 'reproduce with' line -->
|
||||||
|
<tests.verify.phase>true</tests.verify.phase>
|
||||||
</systemProperties>
|
</systemProperties>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|
Loading…
Reference in New Issue