From dde28ddc522cb8a8386f3a9551fe2e5a86845bfe Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Tue, 16 Apr 2019 12:57:05 +0200 Subject: [PATCH] Parallelize compiler tests --- build-common/build.gradle.kts | 2 +- compiler/build.gradle.kts | 6 +----- compiler/container/build.gradle.kts | 2 +- compiler/fir/fir2ir/build.gradle.kts | 2 +- compiler/fir/psi2fir/build.gradle.kts | 2 +- compiler/fir/resolve/build.gradle.kts | 2 +- compiler/incremental-compilation-impl/build.gradle.kts | 2 +- compiler/tests-java8/build.gradle.kts | 2 +- compiler/tests-spec/build.gradle.kts | 2 +- core/descriptors.runtime/build.gradle.kts | 2 +- js/js.tests/build.gradle.kts | 8 ++++---- plugins/jvm-abi-gen/build.gradle.kts | 2 +- 12 files changed, 15 insertions(+), 19 deletions(-) diff --git a/build-common/build.gradle.kts b/build-common/build.gradle.kts index 2e1166a9509..bd85448e01b 100644 --- a/build-common/build.gradle.kts +++ b/build-common/build.gradle.kts @@ -40,4 +40,4 @@ javadocJar() testsJar() -projectTest() +projectTest(parallel = true) diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 3ec9f90d63c..d95d569baa2 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -2,10 +2,6 @@ import java.io.File import org.gradle.api.tasks.bundling.Jar import org.jetbrains.kotlin.gradle.dsl.KotlinCompile -tasks.withType { - maxParallelForks = Math.max(Runtime.getRuntime().availableProcessors() / 2, 1) -} - plugins { kotlin("jvm") id("jps-compatible") @@ -87,7 +83,7 @@ jar.from("../idea/resources") { include("META-INF/extensions/compiler.xml") } -projectTest { +projectTest(parallel = true) { dependsOn(":dist") workingDir = rootDir systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator)) diff --git a/compiler/container/build.gradle.kts b/compiler/container/build.gradle.kts index eb89c02718e..a7d00508bb0 100644 --- a/compiler/container/build.gradle.kts +++ b/compiler/container/build.gradle.kts @@ -24,7 +24,7 @@ sourceSets { testsJar {} -projectTest { +projectTest(parallel = true) { dependsOn(":dist") workingDir = rootDir } diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts index 8d1f47a1e6e..bdef4a8eec5 100644 --- a/compiler/fir/fir2ir/build.gradle.kts +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -39,7 +39,7 @@ sourceSets { "test" { projectDefault() } } -projectTest { +projectTest(parallel = true) { workingDir = rootDir } diff --git a/compiler/fir/psi2fir/build.gradle.kts b/compiler/fir/psi2fir/build.gradle.kts index a96033a0704..33df05ec179 100644 --- a/compiler/fir/psi2fir/build.gradle.kts +++ b/compiler/fir/psi2fir/build.gradle.kts @@ -34,7 +34,7 @@ sourceSets { "test" { projectDefault() } } -projectTest { +projectTest(parallel = true) { workingDir = rootDir } diff --git a/compiler/fir/resolve/build.gradle.kts b/compiler/fir/resolve/build.gradle.kts index ce562b1beca..58a66a5b03d 100644 --- a/compiler/fir/resolve/build.gradle.kts +++ b/compiler/fir/resolve/build.gradle.kts @@ -37,7 +37,7 @@ sourceSets { "test" { projectDefault() } } -projectTest { +projectTest(parallel = true) { workingDir = rootDir jvmArgs!!.removeIf { it.contains("-Xmx") } maxHeapSize = "3g" diff --git a/compiler/incremental-compilation-impl/build.gradle.kts b/compiler/incremental-compilation-impl/build.gradle.kts index 2f8d6fbb566..aa14d1cd868 100644 --- a/compiler/incremental-compilation-impl/build.gradle.kts +++ b/compiler/incremental-compilation-impl/build.gradle.kts @@ -30,7 +30,7 @@ sourceSets { "test" { projectDefault() } } -projectTest { +projectTest(parallel = true) { workingDir = rootDir } diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index 70ecde2a84e..110fdd7f7d2 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -24,7 +24,7 @@ tasks.withType { kotlinOptions.jvmTarget = "1.8" } -projectTest { +projectTest(parallel = true) { executable = "${rootProject.extra["JDK_18"]!!}/bin/java" dependsOn(":dist") workingDir = rootDir diff --git a/compiler/tests-spec/build.gradle.kts b/compiler/tests-spec/build.gradle.kts index 770b0984d25..5f860aa46f3 100644 --- a/compiler/tests-spec/build.gradle.kts +++ b/compiler/tests-spec/build.gradle.kts @@ -12,7 +12,7 @@ sourceSets { "test" { projectDefault() } } -projectTest { +projectTest(parallel = true) { workingDir = rootDir } diff --git a/core/descriptors.runtime/build.gradle.kts b/core/descriptors.runtime/build.gradle.kts index 9ac94724366..c9065d85576 100644 --- a/core/descriptors.runtime/build.gradle.kts +++ b/core/descriptors.runtime/build.gradle.kts @@ -30,6 +30,6 @@ val compileKotlin by tasks.getting(KotlinCompile::class) { val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateRuntimeDescriptorTestsKt") -projectTest { +projectTest(parallel = true) { workingDir = rootDir } diff --git a/js/js.tests/build.gradle.kts b/js/js.tests/build.gradle.kts index dda44985923..04045bcb516 100644 --- a/js/js.tests/build.gradle.kts +++ b/js/js.tests/build.gradle.kts @@ -98,19 +98,19 @@ fun Test.setUpBoxTests(jsEnabled: Boolean, jsIrEnabled: Boolean) { } } -projectTest { +projectTest(parallel = true) { setUpBoxTests(jsEnabled = true, jsIrEnabled = true) } -projectTest("jsTest") { +projectTest("jsTest", true) { setUpBoxTests(jsEnabled = true, jsIrEnabled = false) } -projectTest("jsIrTest") { +projectTest("jsIrTest", true) { setUpBoxTests(jsEnabled = false, jsIrEnabled = true) } -projectTest("quickTest") { +projectTest("quickTest", true) { setUpBoxTests(jsEnabled = true, jsIrEnabled = false) systemProperty("kotlin.js.skipMinificationTest", "true") } diff --git a/plugins/jvm-abi-gen/build.gradle.kts b/plugins/jvm-abi-gen/build.gradle.kts index 8062912d446..e44fb1b1a28 100644 --- a/plugins/jvm-abi-gen/build.gradle.kts +++ b/plugins/jvm-abi-gen/build.gradle.kts @@ -28,7 +28,7 @@ sourceSets { "test" { projectDefault() } } -projectTest { +projectTest(parallel = true) { workingDir = rootDir dependsOn(":dist") }