Skip to content

Commit 5131b74

Browse files
committed
Update to Coroutines 1.6.4
1 parent e044828 commit 5131b74

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ import com.google.firebase.gradle.MultiProjectReleasePlugin
1717

1818
buildscript {
1919
ext.kotlinVersion = '1.7.10'
20-
// Please update $coroutinesVersion alongside $kotlinVersion
21-
// A map of versions can be found here: https://kotlinlang.org/docs/releases.html
22-
ext.coroutinesVersion = '1.5.2'
20+
ext.coroutinesVersion = '1.6.4'
2321

2422
repositories {
2523
google()

firebase-common/ktx/src/test/kotlin/com/google/firebase/ktx/Tests.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import com.google.common.truth.Truth.assertThat
2020
import com.google.firebase.FirebaseApp
2121
import com.google.firebase.FirebaseOptions
2222
import com.google.firebase.platforminfo.UserAgentPublisher
23-
import kotlinx.coroutines.runBlocking
2423
import kotlinx.coroutines.tasks.await
24+
import kotlinx.coroutines.test.runTest
2525
import org.junit.Assert.fail
2626
import org.junit.Test
2727
import org.junit.runner.RunWith
@@ -108,13 +108,12 @@ class KtxTests {
108108
}
109109
}
110110

111-
// TODO(thatfiredev): replace runBlocking() with runTest() once we update kotlin to version >= 1.6
112111
class CoroutinesPlayServicesTests {
113112
// We are only interested in the await() function offered by kotlinx-coroutines-play-services
114113
// So we're not testing the other functions provided by that library.
115114

116115
@Test
117-
fun `Task#await() resolves to the same result as Task#getResult()`() = runBlocking {
116+
fun `Task#await() resolves to the same result as Task#getResult()`() = runTest {
118117
val task = Tasks.forResult(21)
119118

120119
val expected = task.result
@@ -126,7 +125,7 @@ class CoroutinesPlayServicesTests {
126125
}
127126

128127
@Test
129-
fun `Task#await() throws an Exception for failing Tasks`() = runBlocking {
128+
fun `Task#await() throws an Exception for failing Tasks`() = runTest {
130129
val task = Tasks.forException<TestException>(TestException("some error happened"))
131130

132131
try {
@@ -137,6 +136,4 @@ class CoroutinesPlayServicesTests {
137136
assertThat(task.isSuccessful).isFalse()
138137
}
139138
}
140-
141-
// TODO(thatfiredev): add a test for CancellationToken once we support Coroutines >= 1.6
142139
}

firebase-firestore/ktx/ktx.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dependencies {
5757
implementation project(':firebase-common:ktx')
5858
implementation project(':firebase-firestore')
5959
implementation 'androidx.annotation:annotation:1.1.0'
60-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
60+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
6161
implementation 'com.google.android.gms:play-services-basement:18.1.0'
6262
testImplementation project(':firebase-database-collection')
6363
testImplementation 'org.mockito:mockito-core:2.25.0'

0 commit comments

Comments
 (0)