Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,25 @@ if (gradle.startParameter.taskNames.contains("listTestsInPartition")) {
throw GradleException("Invalid test partition")
}

val partitionTasks = ArrayList<Test>()
val partitionTasks = ArrayList<String>()
var testPartitionCounter = 0
subprojects {
// relying on predictable ordering of subprojects
// (see https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#N14CB4)
// since we are splitting these tasks across different github action jobs
val enabled = testPartitionCounter++ % 4 == testPartition
if (enabled) {
val projectPath = this.path
tasks.withType<Test>().configureEach {
partitionTasks.add(this)
val taskPath = projectPath + ":" + this.name
partitionTasks.add(taskPath)
}
}
}

doLast {
File("test-tasks.txt").printWriter().use { writer ->
partitionTasks.forEach { task ->
var taskPath = task.project.path + ":" + task.name
partitionTasks.forEach { taskPath ->
// smoke tests are run separately
// :instrumentation:test runs all instrumentation tests
if (taskPath != ":smoke-tests:test" && taskPath != ":instrumentation:test") {
Expand Down
Loading