Skip to content

Commit 0dd2be1

Browse files
authored
Ywmei/parallel unit tests (#3817)
* run unit test in parallel and new VM every 100 tests
1 parent a1e1dca commit 0dd2be1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

firebase-firestore/firebase-firestore.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ android {
9292
ext.useProdBackendForTests = false
9393
}
9494

95+
tasks.withType(Test) {
96+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
97+
}
98+
9599
android.libraryVariants.all { variant ->
96100
if (findProperty("useProdBackendForTests")) {
97101
variant.buildConfigField("boolean", "USE_EMULATOR_FOR_TESTS", "false")

firebase-firestore/ktx/ktx.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ android {
4444
}
4545
}
4646

47+
tasks.withType(Test) {
48+
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
49+
}
50+
4751
dependencies {
4852
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
4953
implementation project(':firebase-common')

0 commit comments

Comments
 (0)