Add failIfNoTests to samples' build setup.

This commit is contained in:
Olga Maciaszek-Sharma
2018-10-19 13:50:05 +02:00
parent 64d1372fd6
commit dbf1b660de
31 changed files with 200 additions and 2 deletions

View File

@@ -52,6 +52,14 @@ test {
testLogging {
exceptionFormat = 'full'
}
afterSuite { desc, result ->
if (!desc.parent) {
println "Results: (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
if (result.testCount == 0) {
throw new IllegalStateException("No tests were found. Failing the build")
}
}
}
}
task wrapper(type: Wrapper) {

View File

@@ -109,6 +109,12 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
</plugins>
</build>