[Build] Add ability to set fixed numbers of JUnit 5 threads via local.properties

This commit is contained in:
Dmitriy Novozhilov
2021-11-15 12:29:57 +03:00
committed by TeamCityServer
parent 2fb066e261
commit a7bea1ad2f
3 changed files with 12 additions and 2 deletions
@@ -35,4 +35,7 @@ val KotlinBuildProperties.isObsoleteJdkOverrideEnabled: Boolean
get() = getBoolean("kotlin.build.isObsoleteJdkOverrideEnabled", false)
val KotlinBuildProperties.isNativeRuntimeDebugInfoEnabled: Boolean
get() = getBoolean("kotlin.native.isNativeRuntimeDebugInfoEnabled", false)
get() = getBoolean("kotlin.native.isNativeRuntimeDebugInfoEnabled", false)
val KotlinBuildProperties.junit5NumberOfThreadsForParallelExecution: Int?
get() = (getOrNull("kotlin.test.junit5.maxParallelForks") as? String)?.toInt()
+5 -1
View File
@@ -199,6 +199,10 @@ fun Project.projectTest(
systemProperty("jps.kotlin.home", project.rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (project.rootProject.hasProperty("newInferenceTests")) "true" else "false")
systemProperty("org.jetbrains.kotlin.skip.muted.tests", if (project.rootProject.hasProperty("skipMutedTests")) "true" else "false")
project.kotlinBuildProperties.junit5NumberOfThreadsForParallelExecution?.let { n ->
systemProperty("junit.jupiter.execution.parallel.config.strategy", "fixed")
systemProperty("junit.jupiter.execution.parallel.config.fixed.parallelism", n)
}
systemProperty("idea.ignore.disabled.plugins", "true")
@@ -319,4 +323,4 @@ abstract class PublishToMavenLocalSerializable : AbstractPublishToMaven() {
}
}.run()
}
}
}
+3
View File
@@ -67,6 +67,9 @@ org.gradle.vfs.watch=true
# If it differs from default use next flag:
#bootstrap.local.path=/path/to/repo
# Set number of threads which are used for running JUnit 5 tests in concurrent mode
# If not set then min(number of CPU cores, 16) will be used
#kotlin.test.junit5.maxParallelForks=4
# Those properties are used to automatically generate run configurations for modularized
# and full pipeline tests for different sets of test data