Replace usage of TestDispatcher with StandardTestDispatcher in paging-compose - #505
Replace usage of TestDispatcher with StandardTestDispatcher in paging-compose#505veyndan wants to merge 2 commits into
Conversation
|
Hey thanks for the PR. Sorry took me to some time to get to it. I think this and PR 506, 507 are failing from a metalava error that has since been fixed. Can you try rebasing? |
12abfc2 to
2cd7d4e
Compare
|
@claraf3 Rebased all three! |
|
sweet thanks! |
|
Im thinking we can kmp-ify |
|
@claraf3 Yep, could do that instead. Two things of note:
I don't feel strongly about this, so if you think it makes sense to keep using |
|
Ideally our tests would rely on standard kotlin-test classes but it that would touch a lot of our tests so I'll have to take a closer look at that at a later time. But in the meantime I think it makes sense to upstream your work here. Even if we replace use of custom dipatchers, its probably better in the long run to have testutil-ktx multiplatform-ready. Would appreciate it if you close out these few PRs and we have a PR with your multiplatformized classes from |
|
Hi @veyndan, we merged the other two PRs to start moving off of testutils-ktx. We can also merge your multiplatformized classes from |
|
Yep I am — just need to find some time to do it! I'd probably create a separate PR though. As one of the PRs that were merged was very similar to this one (#507), would it make sense to upstream this one too? It isn't necessary as part of maintaining Multiplatform Paging once I've created the other PR, but just if there's a desire to start using classes from |
|
Yep, I think we'd like to move to Although ideally we would rewrite our tests so that we can always rely on |
|
We're seeing some errors in CI that looks like a missing Can you please add the correct annotations? That last line should help verify that you've caught everything. |
002b706 to
b44c4f7
Compare
|
@ianhanniballake Done! |
|
Nice, thanks @veyndan! |
Upstreaming [Multiplatform Paging's kmp-ified testutils-ktx](https://github.com/cashapp/multiplatform-paging/tree/androidx-main-3.2.0-alpha04/testutils/testutils-ktx). See #505 (comment) for more context. Test: ./gradlew test connectedCheck Bug: 270612487 This is an imported pull request from #518. Resolves #518 Github-Pr-Head-Sha: a261291 GitOrigin-RevId: 4d77f0b Change-Id: I2c3e46143ffa369aafed9bbc9da05d4b4636e6d0
…testutils-paging The reasoning is the same as androidx#505, but for `testutils-paging`. Test: ./gradlew test connectedCheck Bug: 270612487 This is an imported pull request from androidx#507. Resolves JetBrains#507 Github-Pr-Head-Sha: d1497e7 GitOrigin-RevId: e1f3a08 Change-Id: Idcd1a1981941baf4ddd93346f87b9e30dbcb746e
…aging-compose In Multiplatform Paging, the classes `DirectDispatcher` and `TestDispatcher` in `testutils-ktx` had to be multiplatformized to allow dependent tests in `paging-compose`, `paging-common`, and `paging-runtime` to be moved to the respective `commonTest` folders. I'm attempting to replace all usages of `DirectDispatcher` and `TestDispatcher` that Multiplatform Paging depends on with those found in `kotlinx.coroutines.test`, so hopefully the `testutils-ktx` dependency no longer has to be multiplatformized in my fork. I'm starting this effort by doing it with `paging-compose`. Test: ./gradlew test connectedCheck Bug: 270612487 This is an imported pull request from androidx#505. Resolves JetBrains#505 Github-Pr-Head-Sha: 002b706 GitOrigin-RevId: 2b32273 Change-Id: Id018cf4bf64dac3154eff2ea98e6145aff4290fc
Upstreaming [Multiplatform Paging's kmp-ified testutils-ktx](https://github.com/cashapp/multiplatform-paging/tree/androidx-main-3.2.0-alpha04/testutils/testutils-ktx). See androidx#505 (comment) for more context. Test: ./gradlew test connectedCheck Bug: 270612487 This is an imported pull request from androidx#518. Resolves JetBrains#518 Github-Pr-Head-Sha: a261291 GitOrigin-RevId: 4d77f0b Change-Id: I2c3e46143ffa369aafed9bbc9da05d4b4636e6d0
In Multiplatform Paging, the classes
DirectDispatcherandTestDispatcherintestutils-ktxhad to be multiplatformized to allow dependent tests inpaging-compose,paging-common, andpaging-runtimeto be moved to the respectivecommonTestfolders.I'm attempting to replace all usages of
DirectDispatcherandTestDispatcherthat Multiplatform Paging depends on with those found inkotlinx.coroutines.test, so hopefully thetestutils-ktxdependency no longer has to be multiplatformized in my fork.I'm starting this effort by doing it with
paging-compose.Test: ./gradlew test connectedCheck
Bug: 270612487