[Native][tests] Don't track used memory when running in TeamCity

This commit is contained in:
Dmitriy Dolovov
2023-05-11 19:46:50 +02:00
committed by Space Team
parent 6f249ab615
commit 42a8b28337
3 changed files with 15 additions and 2 deletions
+10 -1
View File
@@ -24,7 +24,8 @@ private enum class TestProperty(shortName: String) {
GC_SCHEDULER("gcScheduler"),
CACHE_MODE("cacheMode"),
EXECUTION_TIMEOUT("executionTimeout"),
SANITIZER("sanitizer");
SANITIZER("sanitizer"),
TEAMCITY("teamcity");
val fullName = "kotlin.internal.native.test.$shortName"
}
@@ -55,6 +56,11 @@ private class ComputedTestProperties(private val task: Test) {
ComputedTestProperty.Lazy(property.fullName, defaultLazyValue())
}
// Do not attempt to read the property from Gradle. Instead, set it based on the lambda return value.
fun computePrivate(property: TestProperty, value: () -> String) {
computedProperties += ComputedTestProperty.Normal(property.fullName, value())
}
fun lazyClassPath(builder: MutableList<File>.() -> Unit): Lazy<String?> = lazy(LazyThreadSafetyMode.NONE) {
buildList(builder).takeIf { it.isNotEmpty() }?.joinToString(File.pathSeparator) { it.absolutePath }
}
@@ -167,6 +173,9 @@ fun Project.nativeTest(
compute(CACHE_MODE)
compute(EXECUTION_TIMEOUT)
compute(SANITIZER)
// Pass whether tests are running at TeamCity.
computePrivate(TEAMCITY) { kotlinBuildProperties.isTeamcityBuild.toString() }
}
// Pass the current Gradle task name so test can use it in logging.