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

@@ -58,6 +58,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")
}
}
}
}
contracts {

View File

@@ -121,6 +121,12 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
<!-- tag::plugin[] -->
<plugin>
<groupId>org.springframework.cloud</groupId>