-
Notifications
You must be signed in to change notification settings - Fork 554
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
Fix part of #1868: Fix few Topic Tests and Migrate to ViewPager2 #2104
Fix part of #1868: Fix few Topic Tests and Migrate to ViewPager2 #2104
Conversation
Causing a bug in app:
This is because of DataBinding. Fixed using |
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.
LGTM. Let's not merge this and wait for Ben as this was suggested by Ben.
Will need to take a look at this tomorrow. Sorry for the delay. |
@anandwana001 Is there any other issue with this other than the explicit binding requirement? I'm wondering if we move the chapter list recycler view over to using our own data-binding recycler view adapter if that would avoid the need for explicitly calling Also, does this fix the underlying tests? I wasn't sure if ViewPager2 would work, it was an idea after looking at semi-related issues that people ran into with the standard ViewPager. |
For the tests, yes it does fix a lot of test cases after migrating to ViewPager2 |
@BenHenning We cannot use |
All tests are passing on espresso and robolectric. 1Need to run bazel tests, as of now I need to re-setup the bazel as I am getting timed out error. 2Build apk on bazel without extra param leads to error ERROR: app/BUILD.bazel:554:19: output 'app/databinding/view_models_base/bin-files/org.oppia.android.app.view.models-org.oppia.android.app.view.models-setter_store.bin' was not created
ERROR: app/BUILD.bazel:554:19: output 'app/databinding/view_models_base/bin-files/org.oppia.android.app.view.models-org.oppia.android.app.view.models-layoutinfo.bin' was not created
ERROR: app/BUILD.bazel:554:19: output 'app/databinding/view_models_base/bin-files/org.oppia.android.app.view.models-org.oppia.android.app.view.models-br.bin' was not created
ERROR: app/BUILD.bazel:554:19: not all outputs were created or valid
Target //:oppia failed to build build apk successfully on local, using our data binding version of bazel build //oppia --android_databinding_use_v3_4_args --experimental_android_databinding_v2 --java_header_compilation=false --noincremental_dexing --define=android_standalone_dexing_tool=d8_compat_dx 3bazel test //app:TopicLessonsFragmentTest --android_databinding_use_v3_4_args --experimental_android_databinding_v2 --java_header_compilation=false --noincremental_dexing --define=android_standalone_dexing_tool=d8_compat_dx Adding @rt4914 for future reference regarding bazel tests running. |
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.
Thanks @anandwana001! I think the test simplifications are great! Just have a bunch of nits to address, then I think the PR will LGTM.
app/src/main/java/org/oppia/android/app/topic/lessons/StorySummaryViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/topic/lessons/StorySummaryViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentTest.kt
Show resolved
Hide resolved
@anandwana001 what specific issues did you run into with Bazel and how did you work around them? That wasn't entirely clear to me from your comment (& in general, please try to be clear about what you tried that didn't work, and what you tried that did to help others who might run into the same issue in the future). |
I did mention, let me just format it a bit. |
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.
Thanks @anandwana001! PR in its current form looks good, but let's try to consolidate the complexity around scrolling to avoid future developers running into similar pitfalls when working on test stability.
app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt
Outdated
Show resolved
Hide resolved
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.
Thanks @anandwana001. LGTM!
Explanation
Fix part of #1868 -
TopicPracticeFragmentTest
Fix part of #632 - Converting
ChapterSummaryAdapter
to use generic adapterFix #2149 RTL Support to ViewPager
Fix #2194 Migrating to ViewPager2
Fix test cases from
TopicFragmentTest
Fix few test cases from
TopicInfoFragmentTest
Fix test cases from
TopicLessonsFragmentTest
Fix test cases from
TopicRevisionFragmentTest
Checklist