Last active
December 22, 2017 11:28
-
-
Save Idolon-V/3a4252947f114d90e25d4679b2cde6ac to your computer and use it in GitHub Desktop.
Gradle - ignore test failures, but obtain the final result at the end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.gradle.taskGraph.whenReady { taskGraph -> | |
project.tasks.withType(Test).each { Test test -> | |
test.ignoreFailures = true | |
test.afterSuite { td, tr -> | |
print "Tests result: ${tr.resultType}" // one of SUCCESS, FAILURE, SKIPPED | |
if (td.getParent() == null) { | |
project.ext.testFailures = tr.getFailedTestCount() | |
} | |
// … do something basing on result … | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment