What about:
yes <desired input> | gradle test 2>&1 | tee -a gradle.log
yes just repeditively echos whatever it's argument is to stdout
yes