Why does Gradle mark my build with failed tests as successful?
<p>I have a Gradle build with failing tests, but Gradle does not register the build as failed. However, the build does correctly fail if I remove a specific test case. Why is that?</p>

<pre><code>$ ./gradlew clean check

:clean
:compileJava
:processResources UP-TO-DATE
:classes
:compileTestJava
:processTestResources UP-TO-DATE
:testClasses
:test

com.example.FooProgramCliTest &gt; fail FAILED
    java.lang.AssertionError at FooProgramCliTest.java:26

1 test completed, 1 failed
:check

BUILD SUCCESSFUL
</code></pre>

<p>Code sample <a href="https://github.com/emlun/gradle-incorrectly-successful-build/tree/build-succeeds" rel="nofollow">on GitHub</a>, because it's a bit too bulky to meaningfully reproduce in the question body.</p>