Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop gradle build when a unit test fails

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?

like image 419
Codes Avatar asked Jan 22 '17 00:01

Codes


1 Answers

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.

like image 181
Клаус Шварц Avatar answered Oct 24 '22 00:10

Клаус Шварц