Conversation
Bumps `coroutinesVersion` from 1.5.2 to 1.6.1. Updates `kotlinx-coroutines-core` from 1.5.2 to 1.6.1 - [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases) - [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md) - [Commits](Kotlin/kotlinx.coroutines@1.5.2...1.6.1) Updates `kotlinx-coroutines-android` from 1.5.2 to 1.6.1 - [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases) - [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md) - [Commits](Kotlin/kotlinx.coroutines@1.5.2...1.6.1) Updates `kotlinx-coroutines-test` from 1.5.2 to 1.6.1 - [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases) - [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md) - [Commits](Kotlin/kotlinx.coroutines@1.5.2...1.6.1) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
|
You can test the changes on this Pull Request by downloading an installable build, or scanning this QR code: |
| if (index == 0) productVariation.copy(price = null) else productVariation | ||
| } | ||
| whenever(variationsRepository.fetchProductVariations(PRODUCT_ID)) | ||
| whenever(variationsRepository.getProductVariationList(PRODUCT_ID)) |
There was a problem hiding this comment.
ℹ️ It seems the goal of this test is to check that variations without price are filtered out.
The order in which the coroutines are processed in this test has changed and viewModel.viewState.getOrAwaitValue() returns the first value which is set - that's 5 items with a price. This PR changes the mocked value and returns a list with one item without a price for getProductVariationList to fix the test.
There was a problem hiding this comment.
I don't think the right fix is to change the mocked function, as if you check the implementation, we start by emitting the cached values, then we fetch the updated values from network, which means these last values are the ones we care about.
I think after changing the scheduler, the asLiveData behavior changed too (as it uses the Main.immediate dispatcher), and now it receives the two values explicitly, where before it probably did some conflating, and received only the last value. With this in mind, the getOrAwaitValue doesn't work anymore, as it will just return the first element.
So to fix the test, without changing its behavior, we can do something like this:
@Test
fun `when loading variations, then exclude any variations without price`() = testBlocking {
val variations = ProductTestUtils.generateProductVariationList(PRODUCT_ID)
.mapIndexed { index, productVariation ->
if (index == 0) productVariation.copy(price = null) else productVariation
}
whenever(variationsRepository.fetchProductVariations(PRODUCT_ID))
.thenReturn(variations)
var displayedVariations: List<ProductVariation>? = null
viewModel.viewState.observeForever {
displayedVariations = it.variationsList
}
assertThat(displayedVariations).allMatch { it.price != null }
assertThat(displayedVariations?.size).isEqualTo(variations.size - 1)
}WDYT?
There was a problem hiding this comment.
Thanks for sharing your thoughts and the code 🙇 !
think after changing the scheduler, the asLiveData behavior changed too (as it uses the Main.immediate dispatcher), and now it receives the two values explicitly, where before it probably did some conflating, and received only the last value. With this in mind, the getOrAwaitValue doesn't work anymore, as it will just return the first element.
My train of thoughts was the same.
I don't think the right fix is to change the mocked function, as if you check the implementation, we start by emitting the cached values, then we fetch the updated values from network, which means these last values are the ones we care about.
Yes, but it seems the goal of the test is to check that items are filtered not that first a cached value is emitted and then a data from the remote are emitted -> that's why I opted for changing the test, it imho also better corresponds with the test name which says "loading variations" not "fetching variations".
Anyway, if you agree I opted for another solution - I added the code you shared as a new test. So we check both cases and are 100% sure it works as expected. ea761d0
| import org.wordpress.android.fluxc.store.WCProductStore | ||
|
|
||
| class ReviewModerationHandlerTests : BaseUnitTest() { | ||
| class ReviewModerationHandlerTests { |
There was a problem hiding this comment.
I wasn't able to make this test suite work with the new approach - decided to revert to the original.
There was a problem hiding this comment.
I can work on this in a separate PR.
I think there are two reasons for issues with the tests on this class:
- The main reason is the use of
UnconfinedTestScheduleras parameter forrunTest, as it's impossible to dictate the order of execution when using it, where this test suite depends on the order a lot. - The second reason is not being able to collect all items without conflating from the exposed states flow, and this is also related to the used Dispatcher (there are a some tickets about this in the Github repo of the library: How to test all intermediate emissions despite conflation Kotlin/kotlinx.coroutines#3120, as it's a bit confusing)
There was a problem hiding this comment.
The main reason is the use of UnconfinedTestScheduler as parameter for runTest, as it's impossible to dictate the order of execution when using it, where this test suite depends on the order a lot.
I tried making it work even with the StandardTestDispatcher which uses the standardScheduler (even with a combination of the dispatchers). However, I think one vital mistake I did was that I forgot that there were two similar methods runTestAndReturnLastEmittedStatusList and runTestAndCollectAllStatuses - n/c 😞 .
I can work on this in a separate PR
That'd be awesome, thanks so much! Or we could do a pair programming session on this, I think it might be valuable for me :).
|
@malinajirka if it's something you'd like to try, #6251 (hopefully) fixed CodeCov integration. I think it could work if you'll merge the current |
hichamboushaba
left a comment
There was a problem hiding this comment.
Thanks for working on this @malinajirka, this took me very long to review, because I had to learn about the new APIs before, but it's worth it.
I'm pre-approving the PR, I left some comments, but nothing is blocking, great job.
| advanceTimeBy(CreateOrUpdateOrderDraft.DEBOUNCE_DURATION_MS) | ||
| runCurrent() |
There was a problem hiding this comment.
I wonder if an extension like the one below can be useful to avoid having to make calls like this with the new scheduler behavior?
fun TestScope.advanceTimeAndRun(duration: Long) {
advanceTimeBy(duration)
runCurrent()
}And an np comment, I think the deleted empty line should be restored to separate the "act" part from the "assert" one.
There was a problem hiding this comment.
I wonder if an extension like the one below can be useful to avoid having to make calls like this with the new scheduler behavior?
Great idea, added in 8299348 and d606d82
And an np comment, I think the deleted empty line should be restored to separate the "act" part from the "assert" one.
I'm not sure which deleted empty line you mean - I don't see any such change in this class. Either way, feel free to update the code or let me know and I'll update it.
There was a problem hiding this comment.
I'm not sure which deleted empty line you mean
I must've been looking at different line while writing the comment 😅 🤦, please ignore this part.
| if (index == 0) productVariation.copy(price = null) else productVariation | ||
| } | ||
| whenever(variationsRepository.fetchProductVariations(PRODUCT_ID)) | ||
| whenever(variationsRepository.getProductVariationList(PRODUCT_ID)) |
There was a problem hiding this comment.
I don't think the right fix is to change the mocked function, as if you check the implementation, we start by emitting the cached values, then we fetch the updated values from network, which means these last values are the ones we care about.
I think after changing the scheduler, the asLiveData behavior changed too (as it uses the Main.immediate dispatcher), and now it receives the two values explicitly, where before it probably did some conflating, and received only the last value. With this in mind, the getOrAwaitValue doesn't work anymore, as it will just return the first element.
So to fix the test, without changing its behavior, we can do something like this:
@Test
fun `when loading variations, then exclude any variations without price`() = testBlocking {
val variations = ProductTestUtils.generateProductVariationList(PRODUCT_ID)
.mapIndexed { index, productVariation ->
if (index == 0) productVariation.copy(price = null) else productVariation
}
whenever(variationsRepository.fetchProductVariations(PRODUCT_ID))
.thenReturn(variations)
var displayedVariations: List<ProductVariation>? = null
viewModel.viewState.observeForever {
displayedVariations = it.variationsList
}
assertThat(displayedVariations).allMatch { it.price != null }
assertThat(displayedVariations?.size).isEqualTo(variations.size - 1)
}WDYT?
| import org.wordpress.android.fluxc.store.WCProductStore | ||
|
|
||
| class ReviewModerationHandlerTests : BaseUnitTest() { | ||
| class ReviewModerationHandlerTests { |
There was a problem hiding this comment.
I can work on this in a separate PR.
I think there are two reasons for issues with the tests on this class:
- The main reason is the use of
UnconfinedTestScheduleras parameter forrunTest, as it's impossible to dictate the order of execution when using it, where this test suite depends on the order a lot. - The second reason is not being able to collect all items without conflating from the exposed states flow, and this is also related to the used Dispatcher (there are a some tickets about this in the Github repo of the library: How to test all intermediate emissions despite conflation Kotlin/kotlinx.coroutines#3120, as it's a bit confusing)
|
|
||
| @ExperimentalCoroutinesApi | ||
| class CoroutineTestRule(val testDispatcher: TestCoroutineDispatcher = TestCoroutineDispatcher()) : TestWatcher() { | ||
| class CoroutineTestRule(val testDispatcher: TestDispatcher = UnconfinedTestDispatcher()) : TestWatcher() { |
There was a problem hiding this comment.
A suggestion: while I agree that using UnconfinedTestDispatcher is a good default for most of our test cases, it shouldn't be the only way, some tests require some definite and explicit ordering (like the ReviewModerationHandlerTests above), and those would benefit from using StandardTestDispatcher.
So I suggest removing the default value from here, and adding an argument to specify the dispatcher in BaseUnitTest with UnconfinedTestDispatcher as a default value, this would allow child test classes to change the dispatcher easily.
There was a problem hiding this comment.
Great suggestion! I actually had this implemented while trying to fix the reviewHandler tests but reverted it with all the other changes I made. Fixed in f6662b2
|
|
||
| @Suppress("UnnecessaryAbstractClass") | ||
| @RunWith(MockitoJUnitRunner::class) | ||
| abstract class CardReaderBaseUnitTest { |
There was a problem hiding this comment.
I wonder if we shouldn't have a core module for things that need to be part of all modules? Maybe we can start with a core-testing just for test helpers? Not necessarily on this PR though.
There was a problem hiding this comment.
Yeah, I think it'd be great but might need a little more work. Especially when it comes to documentation - we need to make sure we use it correctly and don't add everything that needs to be shared by at least 2 modules there.
|
Another point, I think before merging this, you should make sure you are up-to-date with |
Codecov Report
@@ Coverage Diff @@
## trunk #6292 +/- ##
============================================
+ Coverage 24.59% 24.87% +0.28%
+ Complexity 2602 2587 -15
============================================
Files 786 786
Lines 45920 46087 +167
Branches 5819 5890 +71
============================================
+ Hits 11292 11466 +174
+ Misses 33575 33539 -36
- Partials 1053 1082 +29
Continue to review full report at Codecov.
|
Error TypeErrorDangerfileGenerated by 🚫 dangerJS |
WooCommerce/src/test/kotlin/com/woocommerce/android/tracker/SendTelemetryTest.kt
Show resolved
Hide resolved
.../src/test/kotlin/com/woocommerce/android/ui/orders/creation/CreateOrUpdateOrderDraftTests.kt
Outdated
Show resolved
Hide resolved
|
Thanks so much for the great review @hichamboushaba! Truly appreciate the time you spent on this 🙇. I've implemented most of the suggestions you proposed, great tips! I've also merged trunk into the branch and double checked no new tests which would be affected by the changes were added. Essentially, the only thing I didn't implement is creating a separate "core" module. I think it'd be great if you checked the commits I added before we merge this just to be sure I didn't mess anything up. I'll update it with trunk one more time before the final merge, let me know. Thanks so much!!! Btw I forgot to mention it in the description - this PR changes not just the test package but also the core coroutine package -> if you haven't tested the app it might be worth testing. I run some tests and haven't noticed anything weird. |
hichamboushaba
left a comment
There was a problem hiding this comment.
Looks great, thanks for the changes @malinajirka ![]()
|
Found 1 violations: The PR caused the following dependency changes:expand
+--- androidx.legacy:legacy-support-v4:1.0.0
| \--- androidx.legacy:legacy-support-core-ui:1.0.0
| \--- androidx.slidingpanelayout:slidingpanelayout:1.0.0 -> 1.2.0
| \--- androidx.window:window:1.0.0
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.2
-| | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30 -> 1.6.10 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.5.30 -> 1.6.10
-| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30 -> 1.6.10 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1
+| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 (c)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1 (c)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 (c)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.6.1 (c)
+| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.6.1 (c)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0 -> 1.6.10 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0 -> 1.6.10
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0 -> 1.6.10 (*)
+--- androidx.datastore:datastore-preferences:1.0.0
| \--- androidx.datastore:datastore:1.0.0
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.5.2 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.6.1 (*)
| \--- androidx.datastore:datastore-core:1.0.0
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.6.1 (*)
+--- androidx.navigation:navigation-fragment-ktx:2.4.1
| \--- androidx.navigation:navigation-fragment:2.4.1
| \--- androidx.fragment:fragment-ktx:1.4.1
| \--- androidx.activity:activity-ktx:1.2.3 -> 1.4.0
| +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1 -> 1.5.2 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1 -> 1.6.1 (*)
| \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.0
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.6.1 (*)
+--- org.wordpress:fluxc:trunk-4b7a896b6713caef932133d3a93b8117b414d253
| +--- androidx.room:room-ktx:2.4.2
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.6.1 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.6.1 (*)
+--- org.wordpress.fluxc.plugins:woocommerce:trunk-4b7a896b6713caef932133d3a93b8117b414d253
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.6.1 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.6.1 (*)
+--- com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:v1.3.45
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0 -> 1.5.2 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0 -> 1.6.1 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0 -> 1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0 -> 1.6.1 (*)
+--- project :libs:cardreader
| +--- com.stripe:stripeterminal:2.6.0
| | \--- com.stripe:stripeterminal-core:2.6.0
| | +--- com.stripe:stripeterminal-internal-common:2.6.0
-| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
-| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
+| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 -> 1.6.1 (*)
-| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.5.2
-| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
-| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.5.2
-| | | | +--- org.reactivestreams:reactive-streams:1.0.3
-| | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
-| | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30 -> 1.6.10 (*)
-| | | +--- io.reactivex.rxjava2:rxjava:2.2.8 -> 2.2.21 (*)
-| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30 -> 1.6.10 (*)
+| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.5.2 -> 1.6.1
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 (*)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1 (*)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.6.1
+| | | | +--- org.reactivestreams:reactive-streams:1.0.3
+| | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 (*)
+| | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.1 (*)
+| | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0 -> 1.6.10 (*)
+| | | +--- io.reactivex.rxjava2:rxjava:2.2.8 -> 2.2.21 (*)
+| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0 -> 1.6.10 (*)
| | \--- androidx.lifecycle:lifecycle-livedata-ktx:2.4.0 -> 2.4.1
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.5.2 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.6.1 (*)
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 (*)
+--- com.automattic:about:0.0.4
| +--- androidx.compose.ui:ui:1.0.5 -> 1.1.1
| | +--- androidx.compose.runtime:runtime-saveable:1.1.1
| | | \--- androidx.compose.runtime:runtime:1.1.1
-| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
-| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
+| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 -> 1.6.1 (*)
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
| \--- androidx.compose.ui:ui-tooling:1.0.5 -> 1.1.1
| \--- androidx.compose.animation:animation:1.1.1
| \--- androidx.compose.animation:animation-core:1.1.1
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 -> 1.6.1 (*)
-+--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2 (*)
++--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 (*)
-+--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
++--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 (*)
+--- org.wordpress:mediapicker:trunk-d0db2634cf27511bec3ef9b837f9cfe27c5ab601
| +--- org.wordpress.mediapicker:domain:trunk-d0db2634cf27511bec3ef9b837f9cfe27c5ab601
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
+--- org.wordpress.mediapicker:source-device:trunk-d0db2634cf27511bec3ef9b837f9cfe27c5ab601
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
\--- org.wordpress.mediapicker:source-wordpress:trunk-d0db2634cf27511bec3ef9b837f9cfe27c5ab601
- \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+ \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 -> 1.6.1 (*)
Please review and act accordingly
|
This 'ReviewModerationHandlerTests' test suite is the only such suite that still uses the old way of testing with Coroutines. As part of the Coroutine 1.6 PR (see link below), migrating this test suite to the new way didn't happen as different approaches using both 'Standard' and 'Unconfined' dispatchers didn't work, 3 tests were always failing. PR Link: #6292 Also, a TODO comment with an assignee was added to resolve this suppress warning. Issue: Resolve suppressed Coroutines related 'DEPRECATION' warning for 'ReviewModerationHandlerTests' Link: #6899
Bumps coroutinesVersion from 1.5.2 to 1.6.1.
Updates kotlinx-coroutines-core from 1.5.2 to 1.6.1
Updates kotlinx-coroutines-android from 1.5.2 to 1.6.1
Updates kotlinx-coroutines-test from 1.5.2 to 1.6.1 + migration guide
I was not able to migrate ReviewModerationHandlerTests.kt. I tried several different approaches using both Standard and Unconfined dispatchers, but at least 3 tests were always failing. I'm probably missing something or the tests need to be rewritten. I decided to give up for now, since the tests work with the original approach.
Again, it is recommended to review this commit by commit to follow my train of thoughts. I'm sorry for the number of changes - I didn't realize that tests which live in the CardReaderModule are not using any BaseUnitTest class. Let me know if you'd prefer me to split it into two PRs.