Skip to content

Commit

Permalink
Reduce test logging output from build (#1506)
Browse files Browse the repository at this point in the history
Motivation:
The Gradle build currently produces voluminous test output in the default
configuration. This change reduces the default verbosity to only show
test failures. The test report still contains full output from failed
tests.
Modifications:
Default test logging output verbosity is reduced to show only failed
cases and hide standard out/err from console. Additional configuration
is provided for Gradle `--warn` mode which provides slightly more
output than the current default.
Result:
Terse build output making warnings and failures more obvious
  • Loading branch information
bondolo authored Apr 21, 2021
1 parent c294cc5 commit 487f77e
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import static io.servicetalk.gradle.plugin.internal.ProjectUtils.locateBuildLeve
import static io.servicetalk.gradle.plugin.internal.Versions.PMD_VERSION
import static io.servicetalk.gradle.plugin.internal.Versions.SPOTBUGS_VERSION
import static io.servicetalk.gradle.plugin.internal.Versions.TARGET_VERSION
import static org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import static org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import static org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import static org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
import static org.gradle.api.tasks.testing.logging.TestLogEvent.STARTED


final class ServiceTalkLibraryPlugin extends ServiceTalkCorePlugin {
void apply(Project project) {
Expand Down Expand Up @@ -170,8 +176,15 @@ final class ServiceTalkLibraryPlugin extends ServiceTalkCorePlugin {
systemProperty "junit.jupiter.extensions.autodetection.enabled", "true"

testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true
events = [FAILED]
showStandardStreams = false
exceptionFormat = FULL

warn {
// Show more complete info when gradle run in --warn mode
events = [STARTED, PASSED, SKIPPED, FAILED]
showStandardStreams = true
}
}

jvmArgs "-server", "-Xms2g", "-Xmx4g", "-dsa", "-da", "-ea:io.servicetalk...",
Expand Down

0 comments on commit 487f77e

Please sign in to comment.