Skip to content

Commit

Permalink
chore: configure junit5 parallelism exec
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Nov 8, 2023
1 parent f666c81 commit 5b4bf04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ dependencies {

// Unit/Android tests dependencies
testImplementation(libs.androidx.test.archCore)
testImplementation(libs.junit4) // Maybe migrate completely to Junit 5?
testImplementation(libs.junit5.core)
testImplementation(libs.coroutines.test)
testImplementation(libs.androidx.test.core)
Expand Down
7 changes: 7 additions & 0 deletions build-logic/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ tasks.withType<KotlinCompile>().configureEach {
}
}

tasks.withType<Test> {
systemProperties["junit.jupiter.execution.parallel.enabled"] = true
systemProperties["junit.jupiter.execution.parallel.mode.default"] = "same_thread"
systemProperties["junit.jupiter.execution.parallel.mode.classes.default"] = "concurrent"
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
}

dependencies {
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
Expand Down

0 comments on commit 5b4bf04

Please sign in to comment.