-
Notifications
You must be signed in to change notification settings - Fork 521
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce nested data provider #929
Conversation
test coroutine dispatcher. This includes introducing a test-only module to contain testing dependencies.
DataProviders in a way that doesn't have the same limitations as the previous MutableLiveData-based bridge.
…w-coroutine-live-data-mechanism Conflicts: domain/src/test/java/org/oppia/domain/audio/CellularAudioDialogControllerTest.kt
DataProvider to be set up like transformAsync() but with the ability to change the root DataProvider.
…w-coroutine-live-data-mechanism
…duce-nested-data-provider
…w-coroutine-live-data-mechanism Conflicts: utility/src/main/java/org/oppia/util/data/DataProviders.kt
…duce-nested-data-provider
…w-coroutine-live-data-mechanism Conflicts: data/src/test/java/org/oppia/data/persistence/PersistentCacheStoreTest.kt
…duce-nested-data-provider
For future me, proposed tests that could be added (incomplete): fun testNestedXformedProvider_toLiveData_deliversTransformedValue()
fun testNestedXformedProvider_toLiveData_diffValue_notifiesNested_deliversXformedValueTwo()
fun testNestedXformedProvider_toLiveData_diffValue_notifiesBase_deliversXformedValueTwo()
fun testNestedXformedProvider_toLiveData_diffVal_notifiesXform_deliversXformedValueTwo()
fun testNestedXformedProvider_diffValue_notifiesNested_observeNested_deliversSecondVal()
fun testNestedXformedProvider_differentValue_notifiesBase_observeNested_deliversFirstVal()
fun testNestedXformedProvider_diffValue_notifiesXformed_observeNested_deliversFirstVal()
fun testNestedXformedProvider_diffValue_notifiesNested_observeBase_deliversSecondVal()
fun testNestedXformedProvider_differentValue_notifiesBase_observeBase_deliversSecondVal()
fun testNestedXformedProvider_diffValue_notifiesXformed_observeBase_deliversFirstVal()
fun testNestedXformedProvider_toLiveData_nestedPending_deliversPending()
fun testNestedXformedProvider_toLiveData_nestedFailure_deliversFailure()
fun testNestedXformedProvider_toLiveData_withObserver_callsNestedProvider()
fun testNestedXformedProvider_toLiveData_noObserver_doesNotCallNestedProvider() These are based on the transform async tests except there are some minor alterations (and overall a bunch of simplifications). Edit: actually, these are missing some tests that aren't focusing on the transform function that's passed in. These need to be updated yet. |
implementation to prepare for code review.
DataProviders tests to using TestCoroutineDispatchers utility.
…w-coroutine-live-data-mechanism
…acheStoreTest, and fix FakeSystemClock so that it works properly in test environments.
…w-coroutine-live-data-mechanism
…duce-nested-data-provider Conflicts: utility/src/main/java/org/oppia/util/data/DataProviders.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM, thanks.
Conflicts: testing/src/main/java/org/oppia/testing/FakeSystemClock.kt
…duce-nested-data-provider
@aggarwalpulkit596 de-assigning you since it seems you completed your review without any follow up action items. |
Thanks for the reviews! |
Introduce a dynamic nested data provider. This behaves essentially the same as transformAsync, except the data provider being transformed can be changed. This is specifically needed by questions in order to handle multiple sessions (e.g. each new session involves generating another list of questions to play, and that list is subsequently transformed into the ephemeral state of the question session). See #397 for specifics.