Add an option to log test failure exceptions to the console

(Adam Murdoch) #1

Currently, the dsl:org.gradle.api.tasks.testing.Test task type only logs the name of the failed test class. This means you have to wait until the html test report is generated at the end of the test execution before you can start looking into the failure. It would be nice to add an option which will log the test failure exception and message to the console, as the tests are executing. This would be similar to the option to show test stdout and stderr output on the console.

Implementation ideas

One approach is to add the option to dsl:org.gradle.api.tasks.testing.TestLogging, and add another dsl:org.gradle.api.tasks.testing.TestOutputListener implementation which does the logging.

Extra credit

  • Sanitize the stack traces logged to the console and in the test report, to remove the Gradle test runner infrastructure.

(Andrew Oberstar) #2

Is this the same idea as what is being added to 1.1? If so, might want to update this idea post.