How can I ignore test failures with the gradle robolectric plugin?

android, gradle, robolectric, robolectric-gradle-plugin

Solution

answering very old question, so that it might help others who bump into here

testOptions {
    unitTests.all {
        setIgnoreFailures(true)
    }
}

Problem

I'm using the robolectric-gradle-plugin for robolectric unit tests. I don't want to fail a build on failed tests. Is there a way in DSL or a property not to fail a test on the build similar to `-DtestFailureIgnore=true` on the Surefire Maven plugin? I've tried: ``` robolectric { ignoreFailures = true } ``` and ``` robolectric { ignoreFailure = true } ``` and `-DignoreFailure=true` on the command line. I can't seem to find any documentation of how to do this, or any reference to ignoring tests in the source code.

Original source

Related problems