[Build] Add gradle properties for different sets of modularized testdata
This commit is contained in:
committed by
teamcityserver
parent
d7368c341e
commit
13b5f87f3a
@@ -22,5 +22,14 @@ val KotlinBuildProperties.ignoreTestFailures: Boolean get() = getBoolean("ignore
|
||||
val KotlinBuildProperties.disableWerror: Boolean
|
||||
get() = getBoolean("kotlin.build.disable.werror") || useFir || isInJpsBuildIdeaSync || getBoolean("test.progressive.mode")
|
||||
|
||||
val KotlinBuildProperties.pathToKotlinModularizedTestData: String?
|
||||
get() = getOrNull("kotlin.fir.modularized.testdata.kotlin") as? String
|
||||
|
||||
val KotlinBuildProperties.pathToIntellijModularizedTestData: String?
|
||||
get() = getOrNull("kotlin.fir.modularized.testdata.intellij") as? String
|
||||
|
||||
val KotlinBuildProperties.pathToYoutrackModularizedTestData: String?
|
||||
get() = getOrNull("kotlin.fir.modularized.testdata.youtrack") as? String
|
||||
|
||||
val KotlinBuildProperties.isObsoleteJdkOverrideEnabled: Boolean
|
||||
get() = getBoolean("kotlin.build.isObsoleteJdkOverrideEnabled", false)
|
||||
|
||||
@@ -59,3 +59,11 @@ org.gradle.vfs.watch=true
|
||||
# By default bootstrap compiler is located in ./build/repo directory
|
||||
# If it differs from default use next flag:
|
||||
#bootstrap.local.path=/path/to/repo
|
||||
|
||||
|
||||
# Those properties are used to automatically generate run configurations for modularized
|
||||
# and full pipeline tests for different sets of test data
|
||||
#kotlin.fir.modularized.testdata.kotlin=/path/to/kotlin/project/testdata
|
||||
#kotlin.fir.modularized.testdata.intellij=/path/to/intellij/project/testdata
|
||||
#kotlin.fir.modularized.testdata.youtrack=/path/to/youtrack/project/testdata
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@ val ideaSandboxDir: File by extra
|
||||
val ideaSdkPath: String
|
||||
get() = IntellijRootUtils.getIntellijRootDir(rootProject).absolutePath
|
||||
|
||||
val pathToKotlinModularizedTestData = kotlinBuildProperties.pathToKotlinModularizedTestData
|
||||
|
||||
fun MutableList<String>.addModularizedTestArgs(prefix: String, benchFilter: String?) {
|
||||
add("-${prefix}fir.bench.prefix=$pathToKotlinModularizedTestData")
|
||||
add("-${prefix}fir.bench.jps.dir=$pathToKotlinModularizedTestData/test-project-model-dump")
|
||||
fun MutableList<String>.addModularizedTestArgs(prefix: String, path: String, benchFilter: String?) {
|
||||
add("-${prefix}fir.bench.prefix=$path")
|
||||
add("-${prefix}fir.bench.jps.dir=$path/test-project-model-dump")
|
||||
add("-${prefix}fir.bench.passes=1")
|
||||
add("-${prefix}fir.bench.dump=true")
|
||||
if (benchFilter != null) {
|
||||
@@ -25,7 +23,7 @@ fun MutableList<String>.addModularizedTestArgs(prefix: String, benchFilter: Stri
|
||||
}
|
||||
}
|
||||
|
||||
fun generateVmParametersForJpsConfiguration(benchFilter: String?): String {
|
||||
fun generateVmParametersForJpsConfiguration(path: String, benchFilter: String?): String {
|
||||
val vmParameters = mutableListOf(
|
||||
"-ea",
|
||||
"-XX:+HeapDumpOnOutOfMemoryError",
|
||||
@@ -42,13 +40,13 @@ fun generateVmParametersForJpsConfiguration(benchFilter: String?): String {
|
||||
"-Duse.jps=true",
|
||||
"-Djava.awt.headless=true"
|
||||
)
|
||||
vmParameters.addModularizedTestArgs(prefix = "D", benchFilter = benchFilter)
|
||||
vmParameters.addModularizedTestArgs(prefix = "D", path = path, benchFilter = benchFilter)
|
||||
return vmParameters.joinToString(" ")
|
||||
}
|
||||
|
||||
fun generateArgsForGradleConfiguration(benchFilter: String?): String {
|
||||
fun generateArgsForGradleConfiguration(benchFilter: String?, path: String): String {
|
||||
val args = mutableListOf<String>()
|
||||
args.addModularizedTestArgs(prefix = "P", benchFilter = benchFilter)
|
||||
args.addModularizedTestArgs(prefix = "P", path = path, benchFilter = benchFilter)
|
||||
return args.joinToString(" ")
|
||||
}
|
||||
|
||||
@@ -113,8 +111,8 @@ fun String.convertNameToRunConfigurationFile(prefix: String = ""): File {
|
||||
return rootDir.resolve(".idea/runConfigurations/${fileName}")
|
||||
}
|
||||
|
||||
fun generateJpsConfiguration(name: String, testClassName: String, benchFilter: String?) {
|
||||
val vmParameters = generateVmParametersForJpsConfiguration(benchFilter)
|
||||
fun generateJpsConfiguration(name: String, testClassName: String, path: String, benchFilter: String?) {
|
||||
val vmParameters = generateVmParametersForJpsConfiguration(path, benchFilter)
|
||||
val content = generateXmlContentForJpsConfiguration(
|
||||
name = name,
|
||||
testClassName = testClassName,
|
||||
@@ -123,8 +121,8 @@ fun generateJpsConfiguration(name: String, testClassName: String, benchFilter: S
|
||||
name.convertNameToRunConfigurationFile("JPS").writeText(content)
|
||||
}
|
||||
|
||||
fun generateGradleConfiguration(name: String, testClassName: String, benchFilter: String?) {
|
||||
val vmParameters = generateArgsForGradleConfiguration(benchFilter)
|
||||
fun generateGradleConfiguration(name: String, testClassName: String, path: String, benchFilter: String?) {
|
||||
val vmParameters = generateArgsForGradleConfiguration(benchFilter, path)
|
||||
val content = generateXmlContentForGradleConfiguration(
|
||||
name = name,
|
||||
testClassName = testClassName,
|
||||
@@ -133,23 +131,40 @@ fun generateGradleConfiguration(name: String, testClassName: String, benchFilter
|
||||
name.convertNameToRunConfigurationFile().writeText(content)
|
||||
}
|
||||
|
||||
if (pathToKotlinModularizedTestData != null) {
|
||||
infix fun <A : Any, B> A?.toNotNull(b: B): Pair<A, B>? = this?.to(b)
|
||||
|
||||
val testDataPathList = listOfNotNull(
|
||||
kotlinBuildProperties.pathToKotlinModularizedTestData toNotNull "Kotlin",
|
||||
kotlinBuildProperties.pathToIntellijModularizedTestData toNotNull "IntelliJ",
|
||||
kotlinBuildProperties.pathToYoutrackModularizedTestData toNotNull "YouTrack"
|
||||
)
|
||||
|
||||
val additionalConfigurationsWithFilter = mapOf(
|
||||
"Kotlin" to listOf(
|
||||
"Kotlin. All main modules" to ".*/main",
|
||||
"Kotlin. idea.main module" to ".*/idea/build/.*/main",
|
||||
"Kotlin. idea.test module" to ".*/idea/build/.*/test"
|
||||
)
|
||||
)
|
||||
|
||||
for ((path, projectName) in testDataPathList) {
|
||||
rootProject.afterEvaluate {
|
||||
val configurations = listOf(
|
||||
"Full kotlin" to null,
|
||||
"All main modules" to ".*/main",
|
||||
"idea.main module" to ".*/idea/build/.*/main",
|
||||
"idea.test module" to ".*/idea/build/.*/test"
|
||||
val configurations = mutableListOf<Pair<String, String?>>(
|
||||
"Full $projectName" to null
|
||||
)
|
||||
|
||||
additionalConfigurationsWithFilter[projectName]?.let {
|
||||
configurations.addAll(it)
|
||||
}
|
||||
|
||||
val jpsBuildEnabled = kotlinBuildProperties.isInJpsBuildIdeaSync
|
||||
|
||||
for ((name, benchFilter) in configurations) {
|
||||
generateGradleConfiguration("[MT] $name", "FirResolveModularizedTotalKotlinTest", benchFilter)
|
||||
generateGradleConfiguration("[FP] $name", "FullPipelineModularizedTest", benchFilter)
|
||||
generateGradleConfiguration("[MT] $name", "FirResolveModularizedTotalKotlinTest", path, benchFilter)
|
||||
generateGradleConfiguration("[FP] $name", "FullPipelineModularizedTest", path, benchFilter)
|
||||
if (jpsBuildEnabled) {
|
||||
generateJpsConfiguration("[MT-JPS] $name", "FirResolveModularizedTotalKotlinTest", benchFilter)
|
||||
generateJpsConfiguration("[FP-JPS] $name", "FullPipelineModularizedTest", benchFilter)
|
||||
generateJpsConfiguration("[MT-JPS] $name", "FirResolveModularizedTotalKotlinTest", path, benchFilter)
|
||||
generateJpsConfiguration("[FP-JPS] $name", "FullPipelineModularizedTest", path, benchFilter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user