Skip to content

Commit

Permalink
Don't split integMultiVersionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
blindpirate committed Oct 16, 2019
1 parent 5802843 commit d8fd0eb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun Project.createTasks(sourceSet: SourceSet, testType: TestType) {
internal
fun Project.createTestTask(name: String, executer: String, sourceSet: SourceSet, testType: TestType, extraConfig: Action<IntegrationTest>): TaskProvider<IntegrationTest> =
tasks.register(name, IntegrationTest::class) {
configureTestSplitIfNecessary(sourceSet, testType)
configureTestSplitIfNecessary(name, sourceSet, testType)
description = "Runs ${testType.prefix} with $executer executer"
systemProperties["org.gradle.integtest.executer"] = executer
addDebugProperties()
Expand All @@ -95,7 +95,7 @@ fun Project.createTestTask(name: String, executer: String, sourceSet: SourceSet,


private
fun DistributionTest.configureTestSplitIfNecessary(sourceSet: SourceSet, testType: TestType) {
fun DistributionTest.configureTestSplitIfNecessary(name: String, sourceSet: SourceSet, testType: TestType) {
val testSplit = project.stringPropertyOrEmpty("testSplit")
if (testSplit.isBlank() || (testType == TestType.CROSSVERSION && name != "crossVersionTest")) {
// Cross version tests are splitted by tasks
Expand All @@ -107,7 +107,8 @@ fun DistributionTest.configureTestSplitIfNecessary(sourceSet: SourceSet, testTyp
val numberOfSplits = testSplit.split("/")[1].toInt()
val sourceFiles = sourceSet.groovy.files.sortedBy { it.absolutePath }

if (sourceFiles.size < numberOfSplits) {
if (sourceFiles.size < numberOfSplits || name == "integMultiVersionTest") {
// https://github.com/gradle/gradle-private/issues/2740
enabled = currentSplit == 1
return
}
Expand Down

0 comments on commit d8fd0eb

Please sign in to comment.