I have a large test suite running on travis-ci, which has a textual output. I would like to configure gradle in a way that only for failed tests, the standard output and standard error streams are displayed. For all other tests which have been executed correctly, this should not happen so that the console is not polluted with that noise.
I am aware how to enable or disable the standard output/error logging, but I am unsure how to make this dependend on the test result.
This can be archived with following gradle config
Git repo: https://github.com/calliduslynx/gradle-log-on-failure
Original found here: https://discuss.gradle.org/t/show-stderr-for-failed-tests/8463/7
Add the following configuration block to your build.gradle file:
Documentation can be found here.