From 1eebae5c4e4ed8bc0610334f2d10c979eb3d4d32 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Fri, 10 Feb 2017 06:08:40 +0300 Subject: [PATCH] reporting: use final result instead traversing over all reports.json (including total report called reports.json too) --- .../org/jetbrains/kotlin/Reporter.groovy | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/buildSrc/src/main/groovy/org/jetbrains/kotlin/Reporter.groovy b/buildSrc/src/main/groovy/org/jetbrains/kotlin/Reporter.groovy index 8d91616a1ae..d366cf78cd9 100644 --- a/buildSrc/src/main/groovy/org/jetbrains/kotlin/Reporter.groovy +++ b/buildSrc/src/main/groovy/org/jetbrains/kotlin/Reporter.groovy @@ -26,18 +26,12 @@ class Reporter extends DefaultTask { @TaskAction public void report() { def stats = new RunExternalTestGroup.Statistics() - reportHome.traverse { - println("$it $it.name") - if (it.name == 'results.json') { - def obj = new JsonSlurper().parse(it) - stats.total += obj.statistics.total - stats.passed += obj.statistics.passed - stats.failed += obj.statistics.failed - stats.error += obj.statistics.error - stats.skipped += obj.statistics.skipped - } - FileVisitResult.CONTINUE - } + def obj = new JsonSlurper().parse(new File(reportHome, "results.json")) + stats.total = obj.statistics.total + stats.passed = obj.statistics.passed + stats.failed = obj.statistics.failed + stats.error = obj.statistics.error + stats.skipped = obj.statistics.skipped def epilog = "" def teamcityConfig = System.getenv("TEAMCITY_BUILD_PROPERTIES_FILE")