From f6b6f927ec83b0067d330d606dcf869db97d7029 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 24 Jan 2019 17:33:08 +0200 Subject: [PATCH] Fail randomized testing tasks if no tests ran (#37764) Reverts #36259 in part to make randomized test fail if no tests are ran. This is useful when filtering tests as it's easy to make a typo and think the test ran trough successfully. --- .../src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 54a14138505..893f767e26e 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -904,6 +904,7 @@ class BuildPlugin implements Plugin { project.tasks.withType(RandomizedTestingTask) {task -> jvm "${project.runtimeJavaHome}/bin/java" parallelism System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel) + ifNoTests 'fail' onNonEmptyWorkDirectory 'wipe' leaveTemporary true project.sourceSets.matching { it.name == "test" }.all { test ->