File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 55 */
66
77import datadog.gradle.plugin.ci.findAffectedTaskPath
8- import org.gradle.api.tasks.testing.Test
98import java.io.File
109import 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
3525fun relativeToGitRoot (f : File ): File {
Original file line number Diff line number Diff line change @@ -32,9 +32,14 @@ val skipTestsProvider = rootProject.providers.gradleProperty("skipTests")
3232val skipForkedTestsProvider = rootProject.providers.gradleProperty(" skipForkedTests" )
3333val skipFlakyTestsProvider = rootProject.providers.gradleProperty(" skipFlakyTests" )
3434val 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
3740tasks.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
You can’t perform that action at this time.
0 commit comments