Tweaked performance-tests stats output
This commit is contained in:
@@ -77,10 +77,8 @@ class Stats(
|
||||
|
||||
val shortName = if (perfCounterName.endsWith(": time")) n.removeSuffix(": time") else null
|
||||
|
||||
shortName?.let {
|
||||
TeamCity.test(it, durationMs = mean, includeStats = false) {
|
||||
TeamCity.statValue(it, mean)
|
||||
}
|
||||
TeamCity.test(shortName, durationMs = mean) {
|
||||
TeamCity.statValue(n, mean)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +170,7 @@ class Stats(
|
||||
"$testName stability is $stabilityPercentage %, above accepted level of $acceptanceStabilityLevel %"
|
||||
}
|
||||
|
||||
TeamCity.test(stabilityName, errorDetails = error) {
|
||||
TeamCity.test(stabilityName, errorDetails = error, includeStats = false) {
|
||||
TeamCity.statValue(stabilityName, stabilityPercentage)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,16 +42,18 @@ object TeamCity {
|
||||
test(name, durationMs, errorDetails = if (errors.isNotEmpty()) toDetails(errors) else null, block = block)
|
||||
}
|
||||
|
||||
fun test(name: String, durationMs: Long? = null, includeStats: Boolean = true, errorDetails: String? = null, block: () -> Unit) {
|
||||
testStarted(name)
|
||||
fun test(name: String?, durationMs: Long? = null, includeStats: Boolean = true, errorDetails: String? = null, block: () -> Unit) {
|
||||
name?.let { testStarted(it) }
|
||||
try {
|
||||
block()
|
||||
} finally {
|
||||
if (includeStats) statValue(name, durationMs ?: -1)
|
||||
if (errorDetails != null) {
|
||||
testFailed(name, errorDetails)
|
||||
} else {
|
||||
testFinished(name, durationMs)
|
||||
name?.let {
|
||||
if (includeStats) statValue(it, durationMs ?: -1)
|
||||
if (errorDetails != null) {
|
||||
testFailed(it, errorDetails)
|
||||
} else {
|
||||
testFinished(it, durationMs)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user