diff --git a/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy b/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy index a7d1db1cc8c..33e16feb44a 100644 --- a/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy +++ b/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy @@ -2,6 +2,7 @@ package com.carrotsearch.gradle.junit4 import com.carrotsearch.ant.tasks.junit4.ListenersList import com.carrotsearch.ant.tasks.junit4.listeners.AggregatedEventListener +import com.esotericsoftware.kryo.serializers.FieldSerializer import groovy.xml.NamespaceBuilder import groovy.xml.NamespaceBuilderSupport import org.apache.tools.ant.BuildException @@ -58,6 +59,14 @@ class RandomizedTestingTask extends DefaultTask { @Input boolean enableSystemAssertions = true + @Optional + @Input + boolean leaveTemporary = false + + @Optional + @Input + String ifNoTests = 'ignore' + TestLoggingConfiguration testLoggingConfig = new TestLoggingConfiguration() BalancersConfiguration balancersConfig = new BalancersConfiguration(task: this) @@ -172,9 +181,6 @@ class RandomizedTestingTask extends DefaultTask { } } - // TODO: add leaveTemporary - // TODO: add ifNoTests! - @TaskAction void executeTests() { Map attributes = [ @@ -184,7 +190,9 @@ class RandomizedTestingTask extends DefaultTask { dir: workingDir, tempdir: new File(workingDir, 'temp'), haltOnFailure: true, // we want to capture when a build failed, but will decide whether to rethrow later - shuffleOnSlave: shuffleOnSlave + shuffleOnSlave: shuffleOnSlave, + leaveTemporary: leaveTemporary, + ifNoTests: ifNoTests ] DefaultLogger listener = null diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 07e5ca4c967..c35ec5cd0f6 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -322,6 +322,8 @@ class BuildPlugin implements Plugin { return { jvm "${project.javaHome}/bin/java" parallelism System.getProperty('tests.jvms', 'auto') + ifNoTests 'fail' + leaveTemporary true // TODO: why are we not passing maxmemory to junit4? jvmArg '-Xmx' + System.getProperty('tests.heap.size', '512m')