I have found many posts on how to continue a gradle build when a unit test fails, however I cannot find any posts for how to stop for fail a build if a test fails. Is it possible to stop a debug build when a unit test fails?
Unfortunately solution from accepted answer didn't solve this problem. I found out that starting from Gradle 4.6 there is a failFast
setting for test setup.
Adding this to build.gradle
will stop execution of test cases:
test {
failFast = true
}
You can read more about it in official release notes and docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With