From eeb1c9abf6adf1237bfed4b53bb195a37a51e305 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Sun, 8 Dec 2019 19:06:01 +0100 Subject: [PATCH] Only print the slowest tests at the end of a successful run. Correct verbose mode to parse string switch correctly. --- gradle/testing/defaults-tests.gradle | 2 +- gradle/testing/slowest-tests-at-end.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/testing/defaults-tests.gradle b/gradle/testing/defaults-tests.gradle index 3dcf76cc0c6..f42bdba789c 100644 --- a/gradle/testing/defaults-tests.gradle +++ b/gradle/testing/defaults-tests.gradle @@ -5,7 +5,7 @@ def verboseModeHookInstalled = false allprojects { plugins.withType(JavaPlugin) { - def verboseMode = propertyOrDefault("tests.verbose", "false") + def verboseMode = Boolean.parseBoolean(propertyOrDefault("tests.verbose", "false")) project.ext { testsWorkDir = file("${buildDir}/tmp/tests-cwd") diff --git a/gradle/testing/slowest-tests-at-end.gradle b/gradle/testing/slowest-tests-at-end.gradle index b3e6d204965..5c26da93aa4 100644 --- a/gradle/testing/slowest-tests-at-end.gradle +++ b/gradle/testing/slowest-tests-at-end.gradle @@ -15,8 +15,8 @@ allprojects { } } -gradle.buildFinished { - if (allTests) { +gradle.buildFinished { result -> + if (allTests && result.getFailure() == null) { def slowest = allTests .sort { a, b -> b.duration.compareTo(a.duration) } .take(10)