minor: script some test cases to speedup parallel execution

This commit is contained in:
Ilya Chernikov
2023-06-15 12:26:46 +02:00
committed by Space Team
parent 3e5be0909a
commit 7db9f9c3ae
2 changed files with 41 additions and 37 deletions
@@ -367,7 +367,7 @@ class JvmIdeServicesTest : TestCase() {
}
}
class LegacyReplTestLong : TestCase() {
class LegacyReplTestLong1 : TestCase() {
fun test256Evals() {
JvmTestRepl()
.use { repl ->
@@ -397,7 +397,9 @@ class LegacyReplTestLong : TestCase() {
assertEquals(evaluated.toString(), evals, (evaluated?.result as ResultValue.Value?)?.value)
}
}
}
class LegacyReplTestLong2 : TestCase() {
fun testReplSlowdownKt22740() {
JvmTestRepl()
.use { repl ->
@@ -506,42 +506,6 @@ class ReplCompletionAndErrorsAnalysisTest : TestCase() {
}
}
@Test
fun testLongRunningCompilationWithReceiver() = test {
// This test normally completes in about 8-13s
// Removing skip* configuration parameters should slow down the test (2-3 times)
val conf = ScriptCompilationConfiguration {
jvm {
updateClasspath(classpathFromClass<TestReceiver1>())
}
implicitReceivers(TestReceiver1::class, TestReceiver2::class)
skipExtensionsResolutionForImplicits(KotlinType(TestReceiver1::class))
skipExtensionsResolutionForImplicitsExceptInnermost(KotlinType(TestReceiver2::class))
}
val writer = System.out.writer()
for (i in 1..200) {
run(longCompilationRun(writer, i, conf))
run {
compilationConfiguration = conf
code = """
val x = xyz
""".trimIndent()
cursor = 11
expect {
completions.mode = ComparisonType.EQUALS
addCompletion("xyz1", "xyz1", "Int", "property")
addCompletion("xyz2", "xyz2", "Int", "property")
}
loggingInfo = CSVLoggingInfo(complete = CSVLoggingInfoItem(writer, i, "complete;"))
}
}
}
private val setupDefaultImportsCompletionRun: TestRunConfigurator = {
compilationConfiguration = ScriptCompilationConfiguration {
defaultImports(listOf("kotlin.math.atan"))
@@ -630,3 +594,41 @@ private fun longCompletionRun(writer: Writer, i: Int, conf: ScriptCompilationCon
}
}
class ReplCompletionAndErrorsAnalysisLongRunningTest1 : TestCase() {
@Test
fun testLongRunningCompilationWithReceiver() = test {
// This test normally completes in about 8-13s
// Removing skip* configuration parameters should slow down the test (2-3 times)
val conf = ScriptCompilationConfiguration {
jvm {
updateClasspath(classpathFromClass<TestReceiver1>())
}
implicitReceivers(TestReceiver1::class, TestReceiver2::class)
skipExtensionsResolutionForImplicits(KotlinType(TestReceiver1::class))
skipExtensionsResolutionForImplicitsExceptInnermost(KotlinType(TestReceiver2::class))
}
val writer = System.out.writer()
for (i in 1..200) {
run(longCompilationRun(writer, i, conf))
run {
compilationConfiguration = conf
code = """
val x = xyz
""".trimIndent()
cursor = 11
expect {
completions.mode = ComparisonType.EQUALS
addCompletion("xyz1", "xyz1", "Int", "property")
addCompletion("xyz2", "xyz2", "Int", "property")
}
loggingInfo = CSVLoggingInfo(complete = CSVLoggingInfoItem(writer, i, "complete;"))
}
}
}
}