FIR IDE: add basic project performance test

This commit is contained in:
Roman Golyshev
2020-12-11 20:04:51 +03:00
committed by Ilya Kirillov
parent baad0d698f
commit a22a6b4338
3 changed files with 120 additions and 0 deletions
@@ -30,6 +30,29 @@ dependencies {
testRuntime(intellijDep())
compile(intellijPluginDep("java"))
testRuntimeOnly(intellijPluginDep("java"))
testRuntimeOnly(intellijDep())
testRuntimeOnly(intellijRuntimeAnnotations())
testRuntimeOnly(toolsJar())
testRuntimeOnly(project(":kotlin-reflect"))
testRuntimeOnly(project(":plugins:android-extensions-ide"))
testRuntimeOnly(project(":plugins:kapt3-idea"))
testRuntimeOnly(project(":sam-with-receiver-ide-plugin"))
testRuntimeOnly(project(":noarg-ide-plugin"))
testRuntimeOnly(project(":allopen-ide-plugin"))
testRuntimeOnly(project(":kotlin-scripting-idea"))
testRuntimeOnly(project(":kotlinx-serialization-ide-plugin"))
testRuntimeOnly(project(":plugins:parcelize:parcelize-ide"))
testRuntimeOnly(project(":nj2k:nj2k-services"))
testRuntimeOnly(project(":kotlin-reflect"))
testRuntimeOnly(project(":idea:kotlin-gradle-tooling"))
testRuntimeOnly(project(":kotlin-gradle-statistics"))
testImplementation("khttp:khttp:1.0.0")
testImplementation(intellijPluginDep("gradle-java"))
testRuntimeOnly(intellijPluginDep("gradle-java"))
}
sourceSets {
@@ -51,6 +74,7 @@ projectTest(parallel = true) {
testsJar()
projectTest(taskName = "ideaFirPerformanceTest") {
exclude("**/*WholeProjectPerformanceComparisonFirImplTest*")
val currentOs = org.gradle.internal.os.OperatingSystem.current()
if (!currentOs.isWindows) {
@@ -92,3 +116,28 @@ projectTest(taskName = "ideaFirPerformanceTest") {
systemProperty("kotlin.test.gradle.import.arguments", "-PcacheRedirectorEnabled=$it")
}
}
projectTest(taskName = "firProjectPerformanceTest") {
include("**/*WholeProjectPerformanceComparisonFirImplTest*")
workingDir = rootDir
jvmArgs?.removeAll { it.startsWith("-Xmx") }
maxHeapSize = "3g"
jvmArgs("-DperformanceProjects=${System.getProperty("performanceProjects")}")
jvmArgs("-Didea.debug.mode=true")
jvmArgs("-DemptyProfile=${System.getProperty("emptyProfile")}")
jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=50")
jvmArgs(
"-XX:+UseCompressedOops",
"-XX:+UseConcMarkSweepGC"
)
doFirst {
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
project.findProperty("cacheRedirectorEnabled")?.let {
systemProperty("kotlin.test.gradle.import.arguments", "-PcacheRedirectorEnabled=$it")
}
}
}
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.perf
import org.jetbrains.kotlin.idea.perf.common.AbstractWholeProjectPerformanceComparisonTest
class WholeProjectPerformanceComparisonFirImplTest : AbstractWholeProjectPerformanceComparisonTest() {
override val testPrefix: String = "FIR"
override fun getWarmUpProject(): WarmUpProject = warmUpProject
fun testRustPlugin() {
doTestRustPlugin()
}
companion object {
private val hwStats: Stats = Stats("FIR warmup project")
private val warmUpProject = WarmUpProject(hwStats)
}
}
@@ -0,0 +1,49 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.perf.common
import org.jetbrains.kotlin.idea.perf.*
import org.jetbrains.kotlin.idea.perf.util.TeamCity
import org.jetbrains.kotlin.idea.testFramework.ProjectOpenAction
abstract class AbstractWholeProjectPerformanceComparisonTest : AbstractPerformanceProjectsTest() {
abstract val testPrefix: String
abstract fun getWarmUpProject(): WarmUpProject
override fun setUp() {
super.setUp()
getWarmUpProject().warmUp(this)
}
protected fun doTestRustPlugin() {
TeamCity.suite("$testPrefix Rust plugin") {
Stats("$testPrefix Rust plugin").use {
perfOpenRustPluginProject(it)
val filesToHighlight = arrayOf(
"src/main/kotlin/org/rust/ide/inspections/RsExternalLinterInspection.kt",
"src/main/kotlin/org/rust/ide/injected/RsDoctestLanguageInjector.kt",
"src/main/kotlin/org/rust/cargo/runconfig/filters/RegexpFileLinkFilter.kt",
)
filesToHighlight.forEach { file -> perfHighlightFile(file, stats = it) }
}
}
}
private fun perfOpenRustPluginProject(stats: Stats) {
myProject = perfOpenProject(
name = "intellijRustPlugin",
stats = stats,
note = "",
path = "../intellij-rust",
openAction = ProjectOpenAction.GRADLE_PROJECT,
fast = true
)
}
}