Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds TestCoroutineDispatcher + LiveData coroutines support #695

merged 22 commits into from Aug 27, 2019


Copy link

manuelvicnt commented May 17, 2019

馃摙 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

馃摐 Description

Used the new experimental TestCoroutineDispatcher to fix #655.
And the new LiveData coroutines support to replace LiveData Transformations.

馃挕 Motivation and Context

Before, we didn't have the option to stop / resume the CoroutinesDispatcher when injected with our CoroutinesDispatcherProvider so we couldn't test logic that relies on that.

馃挌 How did you test it?

Unit tests

馃摑 Checklist

  • I ran ./gradlew spotlessApply before submitting the PR
  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing

馃敭 Next steps

When the API hits stable, we'll migrate all the tests to use this. runBlocking in tests should migrate to runBlockingTest.

馃摳 Screenshots / GIFs

manuelvicnt added 6 commits May 17, 2019
@manuelvicnt manuelvicnt marked this pull request as ready for review Jun 20, 2019
manuelvicnt added 4 commits Jun 20, 2019

This comment has been minimized.

Copy link

florina-muntenescu commented Jun 24, 2019

The fail seems genuine:

 java.lang.RuntimeException: Duplicate class kotlinx.coroutines.test.TimedRunnable found in modules kotlinx-coroutines-core-1.2.2.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.2) and kotlinx-coroutines-test-1.2.2.jar (org.jetbrains.kotlinx:kotlinx-coroutines-test:1.2.2)

Could you fix it, rebase and if everything passes, merge?

manuelvicnt added 5 commits Jul 23, 2019
manuelvicnt added 3 commits Aug 26, 2019
@manuelvicnt manuelvicnt merged commit 9aa03c4 into master Aug 27, 2019
3 checks passed
3 checks passed
ci/circleci: build Your tests passed on CircleCI!
ci/circleci: test_instrumented Your tests passed on CircleCI!
cla/google All necessary CLAs are signed
@manuelvicnt manuelvicnt deleted the mv/coroutines_test branch Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can鈥檛 perform that action at this time.