From 5c58a9dfd1f285ce737e0162515690fef04031ba Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Tue, 26 May 2020 21:49:38 +0200 Subject: [PATCH] PerfTests gradle interceptor clean up --- .../HighlightWholeProjectPerformanceTest.kt | 22 +++++++++---------- .../kotlin/idea/perf/util/logging.kt | 2 +- .../GradleProcessOutputInterceptor.kt | 5 ++++- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/HighlightWholeProjectPerformanceTest.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/HighlightWholeProjectPerformanceTest.kt index f922eeff7ed..5960600feb9 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/HighlightWholeProjectPerformanceTest.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/HighlightWholeProjectPerformanceTest.kt @@ -38,18 +38,17 @@ class HighlightWholeProjectPerformanceTest : UsefulTestCase() { fun testHighlightAllKtFilesInProject() { val emptyProfile = System.getProperty("emptyProfile", "false").toBoolean() val projectSpecs = projectSpecs() - for (projectSpec in projectSpecs) { - val projectName = projectSpec.name - val projectPath = projectSpec.path + suite(suiteName = "allKtFilesInProject") { + app { + warmUpProject() - suite(suiteName = "$projectName project") { - app { - warmUpProject() - - with(config) { - warmup = 1 - iterations = 3 - } + with(config) { + warmup = 1 + iterations = 3 + } + for (projectSpec in projectSpecs) { + val projectName = projectSpec.name + val projectPath = projectSpec.path try { project(ExternalProject(projectPath, ProjectOpenAction.GRADLE_PROJECT), refresh = true) { @@ -93,7 +92,6 @@ class HighlightWholeProjectPerformanceTest : UsefulTestCase() { // nothing as it is already caught by perfTest } } - } } } diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt index 1cbcf4ab0de..d2405510e65 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt @@ -9,7 +9,7 @@ import java.io.PrintWriter import java.io.StringWriter inline fun gradleMessage(block: () -> String) { - //print("#gradle ${block()}") + print("#gradle ${block()}") } inline fun logMessage(message: () -> String) { diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/GradleProcessOutputInterceptor.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/GradleProcessOutputInterceptor.kt index 8247f9f9802..1158e4d1282 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/GradleProcessOutputInterceptor.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/GradleProcessOutputInterceptor.kt @@ -24,8 +24,11 @@ interface GradleProcessOutputInterceptor { fun install(parentDisposable: Disposable) { val installedExtensions = EP.extensions + val actual = installedExtensions.firstIsInstanceOrNull() + if (actual is GradleProcessOutputInterceptorImpl) return + assertNull( - installedExtensions.firstIsInstanceOrNull(), + actual, "Another ${GradleProcessOutputInterceptor::class.java.simpleName} is already installed" )