Add failIfNoTests to samples' build setup.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user