Skip to content

Commit

Permalink
[gradle] Disable parallel tests run for gradle tests
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Mar 7, 2024
1 parent f07e220 commit f6c8130
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gradle-plugins/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ tasks.test {
}
}

if (properties.getOrDefault("dev.junit.parallel", "false") == "true") {
logger.lifecycle("Test task will run in parallel")
tasks.withType(Test::class.java) {
//https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution-config-properties
systemProperties["junit.jupiter.execution.parallel.enabled"] = true
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent"
}
}

/**
* Gradle 8.0 removed auto downloading of requested toolchains unless a toolchain repository is configured.
* For now, the only option to enable auto downloading out-of-the-box is to use Foojay Disco resolver,
Expand Down
4 changes: 4 additions & 0 deletions gradle-plugins/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
org.gradle.parallel=true
org.gradle.configuration-cache=true
org.gradle.caching=true
org.gradle.daemon=true
kotlin.code.style=official

# CI agents don't have enough resources to support it :(
dev.junit.parallel=false

# Default version of Compose Libraries used by Gradle plugin
compose.version=1.6.0
# The latest version of Compose Compiler used by Gradle plugin. Used only in tests/CI.
Expand Down

0 comments on commit f6c8130

Please sign in to comment.