Skip to content

Commit ffc8579

Browse files
authored
Revert "Put activePartitioning in ci-jobs plugin (#9912)"
This reverts commit 54da873.
1 parent c6e7fca commit ffc8579

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

buildSrc/src/main/kotlin/datadog.ci-jobs.gradle.kts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
import datadog.gradle.plugin.ci.findAffectedTaskPath
8-
import org.gradle.api.tasks.testing.Test
98
import java.io.File
109
import kotlin.math.abs
1110

@@ -21,15 +20,6 @@ allprojects {
2120
val currentTaskPartition = abs(project.path.hashCode() % taskPartitionCount.toInt())
2221
extra.set("activePartition", currentTaskPartition == taskPartition.toInt())
2322
}
24-
25-
// Disable test tasks if not in active partition
26-
val activePartitionProvider = providers.provider {
27-
project.extra.properties["activePartition"] as? Boolean ?: true
28-
}
29-
30-
tasks.withType<Test>().configureEach {
31-
enabled = activePartitionProvider.get()
32-
}
3323
}
3424

3525
fun relativeToGitRoot(f: File): File {

buildSrc/src/main/kotlin/datadog.configure-tests.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ val skipTestsProvider = rootProject.providers.gradleProperty("skipTests")
3232
val skipForkedTestsProvider = rootProject.providers.gradleProperty("skipForkedTests")
3333
val skipFlakyTestsProvider = rootProject.providers.gradleProperty("skipFlakyTests")
3434
val runFlakyTestsProvider = rootProject.providers.gradleProperty("runFlakyTests")
35+
val activePartitionProvider = providers.provider {
36+
project.extra.properties["activePartition"] as? Boolean ?: true
37+
}
3538

3639
// Go through the Test tasks and configure them
3740
tasks.withType<Test>().configureEach {
41+
enabled = activePartitionProvider.get()
42+
3843
// Disable all tests if skipTests property was specified
3944
onlyIf("skipTests are undefined or false") { !skipTestsProvider.isPresent }
4045

0 commit comments

Comments
 (0)