Add prefix for inner test classes in ide perf tests to avoid metric name clashes
This commit is contained in:
+11
-1
@@ -34,6 +34,16 @@ abstract class AbstractPerformanceTypingIndentationTest : KotlinLightCodeInsight
|
|||||||
).run()
|
).run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun testName(): String {
|
||||||
|
val javaClass = this.javaClass
|
||||||
|
val testName = getTestName(false)
|
||||||
|
return if (javaClass.isMemberClass) {
|
||||||
|
"${javaClass.simpleName} - $testName"
|
||||||
|
} else {
|
||||||
|
testName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected fun doPerfTest(unused: String) {
|
protected fun doPerfTest(unused: String) {
|
||||||
val testName = getTestName(false)
|
val testName = getTestName(false)
|
||||||
|
|
||||||
@@ -50,7 +60,7 @@ abstract class AbstractPerformanceTypingIndentationTest : KotlinLightCodeInsight
|
|||||||
configurator.configureSettings()
|
configurator.configureSettings()
|
||||||
|
|
||||||
performanceTest<Unit, Unit> {
|
performanceTest<Unit, Unit> {
|
||||||
name(testName)
|
name(testName())
|
||||||
stats(stats)
|
stats(stats)
|
||||||
warmUpIterations(20)
|
warmUpIterations(20)
|
||||||
iterations(30)
|
iterations(30)
|
||||||
|
|||||||
@@ -49,8 +49,10 @@ data class Benchmark(
|
|||||||
metrics.forEach { it.resetValue() }
|
metrics.forEach { it.resetValue() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun String?.escapeName() = this?.replace(Regex("[^A-Za-z0-9_]"), "_")
|
||||||
|
|
||||||
fun fileName(): String =
|
fun fileName(): String =
|
||||||
listOfNotNull(benchmark, name?.replace("[^A-Za-z0-9_]", ""), buildId?.toString()).joinToString(separator = "_")
|
listOfNotNull(benchmark?.escapeName(), name?.escapeName(), buildId?.toString()).joinToString(separator = "_")
|
||||||
|
|
||||||
fun cleanUp() {
|
fun cleanUp() {
|
||||||
metrics?.forEach { it.cleanUp() }
|
metrics?.forEach { it.cleanUp() }
|
||||||
|
|||||||
Reference in New Issue
Block a user