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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor topic to use profile #5598

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

tobioyelekan
Copy link
Contributor

Explanation

Fixes part of #4865

This PR aim to refactor topic package to use ProfileId
Changes include all topic fragments, presenters, and TopicActivity
Also updated the test classes.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

@tobioyelekan tobioyelekan requested a review from a team as a code owner December 15, 2024 05:05
@tobioyelekan
Copy link
Contributor Author

@adhiamboperes PTAL

Copy link

Coverage Report

Results

Number of files assessed: 39
Overall Coverage: 0.00%
Coverage Analysis: PASS

Exempted coverage

Files exempted from coverage
File Exemption Reason
CompletedStoryItemViewModel.ktapp/src/main/java/org/oppia/android/app/completedstorylist/CompletedStoryItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
ExplorationActivityPresenter.ktapp/src/main/java/org/oppia/android/app/player/exploration/ExplorationActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
TopicViewModel.ktapp/src/main/java/org/oppia/android/app/topic/TopicViewModel.kt
This file is exempted from having a test file; skipping coverage check.
TopicActivityPresenter.ktapp/src/main/java/org/oppia/android/app/topic/TopicActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
TopicActivity.ktapp/src/main/java/org/oppia/android/app/topic/TopicActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/topic/TopicFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
TopicInfoFragment.ktapp/src/main/java/org/oppia/android/app/topic/info/TopicInfoFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicInfoFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/topic/info/TopicInfoFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
RevisionCardViewModel.ktapp/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardViewModel.kt
This file is exempted from having a test file; skipping coverage check.
RevisionCardActivity.ktapp/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
RevisionCardActivityPresenter.ktapp/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
RevisionCardFragment.ktapp/src/main/java/org/oppia/android/app/topic/revisioncard/RevisionCardFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicPracticeViewModel.ktapp/src/main/java/org/oppia/android/app/topic/practice/TopicPracticeViewModel.kt
This file is exempted from having a test file; skipping coverage check.
TopicPracticeFragment.ktapp/src/main/java/org/oppia/android/app/topic/practice/TopicPracticeFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicPracticeFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
TopicFragment.ktapp/src/main/java/org/oppia/android/app/topic/TopicFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicRevisionViewModel.ktapp/src/main/java/org/oppia/android/app/topic/revision/TopicRevisionViewModel.kt
This file is exempted from having a test file; skipping coverage check.
TopicRevisionFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
TopicRevisionFragment.ktapp/src/main/java/org/oppia/android/app/topic/revision/TopicRevisionFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
ViewPagerAdapter.ktapp/src/main/java/org/oppia/android/app/topic/ViewPagerAdapter.kt
This file is exempted from having a test file; skipping coverage check.
TopicLessonViewModel.ktapp/src/main/java/org/oppia/android/app/topic/lessons/TopicLessonViewModel.kt
This file is exempted from having a test file; skipping coverage check.
TopicLessonsFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
TopicLessonsFragment.ktapp/src/main/java/org/oppia/android/app/topic/lessons/TopicLessonsFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
RouteToRevisionCardListener.ktapp/src/main/java/org/oppia/android/app/topic/RouteToRevisionCardListener.kt
This file is exempted from having a test file; skipping coverage check.
HomeFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/home/HomeFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
RouteToTopicListener.ktapp/src/main/java/org/oppia/android/app/home/RouteToTopicListener.kt
This file is exempted from having a test file; skipping coverage check.
HomeActivity.ktapp/src/main/java/org/oppia/android/app/home/HomeActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
RouteToTopicPlayStoryListener.ktapp/src/main/java/org/oppia/android/app/home/RouteToTopicPlayStoryListener.kt
This file is exempted from having a test file; skipping coverage check.
PromotedStoryViewModel.ktapp/src/main/java/org/oppia/android/app/home/promotedlist/PromotedStoryViewModel.kt
This file is incompatible with code coverage tooling; skipping coverage check.
RecentlyPlayedStorySummaryViewModel.ktapp/src/main/java/org/oppia/android/app/profileprogress/RecentlyPlayedStorySummaryViewModel.kt
This file is exempted from having a test file; skipping coverage check.
OngoingTopicItemViewModel.ktapp/src/main/java/org/oppia/android/app/ongoingtopiclist/OngoingTopicItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
ClassroomListFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/classroom/ClassroomListFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
ClassroomListActivity.ktapp/src/main/java/org/oppia/android/app/classroom/ClassroomListActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
NavigationDrawerTestActivity.ktapp/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt
This file is exempted from having a test file; skipping coverage check.
TopicTestActivity.ktapp/src/main/java/org/oppia/android/app/testing/TopicTestActivity.kt
This file is exempted from having a test file; skipping coverage check.
TopicTestActivityForStory.ktapp/src/main/java/org/oppia/android/app/testing/TopicTestActivityForStory.kt
This file is incompatible with code coverage tooling; skipping coverage check.
TopicRevisionTestActivity.ktapp/src/main/java/org/oppia/android/app/testing/TopicRevisionTestActivity.kt
This file is exempted from having a test file; skipping coverage check.
TopicRevisionTestActivityPresenter.ktapp/src/main/java/org/oppia/android/app/testing/TopicRevisionTestActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
HomeFragmentTestActivity.ktapp/src/main/java/org/oppia/android/app/testing/HomeFragmentTestActivity.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

@tobioyelekan
Copy link
Contributor Author

@adhiamboperes not sure why the Roboelectric tests failed, could you please help run it again?

Copy link

APK & AAB differences analysis

Note that this is a summarized snapshot. See the CI artifacts for detailed differences.

Dev

Expand to see flavor specifics

Universal APK

APK file size: 19 MiB (old), 19 MiB (new), 300 bytes (Removed)

APK download size (estimated): 17 MiB (old), 17 MiB (new), 234 bytes (Removed)

Method count: 260195 (old), 260196 (new), 1 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 6818 (old), 6818 (new), 0 (No change)

  • Anim: 43 (old), 43 (new), 0 (No change)
  • Animator: 26 (old), 26 (new), 0 (No change)
  • Array: 15 (old), 15 (new), 0 (No change)
  • Attr: 922 (old), 922 (new), 0 (No change)
  • Bool: 9 (old), 9 (new), 0 (No change)
  • Color: 967 (old), 967 (new), 0 (No change)
  • Dimen: 1048 (old), 1048 (new), 0 (No change)
  • Drawable: 380 (old), 380 (new), 0 (No change)
  • Id: 1275 (old), 1275 (new), 0 (No change)
  • Integer: 37 (old), 37 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 380 (old), 380 (new), 0 (No change)
  • Menu: 3 (old), 3 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • Raw: 2 (old), 2 (new), 0 (No change)
  • String: 852 (old), 852 (new), 0 (No change)
  • Style: 831 (old), 831 (new), 0 (No change)
  • Xml: 6 (old), 6 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 18 MiB (old), 18 MiB (new), 300 bytes (Removed)
APK download size (estimated): 17 MiB (old), 17 MiB (new), 241 bytes (Removed)
Method count: 260195 (old), 260196 (new), 1 (Added)

Configuration hdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change)
APK download size (estimated): 18 KiB (old), 18 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 49 KiB (old), 49 KiB (new), 0 bytes (No change)
APK download size (estimated): 14 KiB (old), 14 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 45 KiB (old), 45 KiB (new), 0 bytes (No change)
APK download size (estimated): 14 KiB (old), 14 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 86 KiB (old), 86 KiB (new), 0 bytes (No change)
APK download size (estimated): 29 KiB (old), 29 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 57 KiB (old), 57 KiB (new), 0 bytes (No change)
APK download size (estimated): 21 KiB (old), 21 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 63 KiB (old), 63 KiB (new), 0 bytes (No change)
APK download size (estimated): 29 KiB (old), 29 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 63 KiB (old), 63 KiB (new), 0 bytes (No change)
APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Alpha

Expand to see flavor specifics

Universal APK

APK file size: 11 MiB (old), 11 MiB (new), 112 bytes (Removed)

APK download size (estimated): 10 MiB (old), 10 MiB (new), 19 bytes (Added)

Method count: 116265 (old), 116266 (new), 1 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 5786 (old), 5786 (new), 0 (No change)

  • Anim: 33 (old), 33 (new), 0 (No change)
  • Animator: 24 (old), 24 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 888 (old), 888 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 820 (old), 820 (new), 0 (No change)
  • Dimen: 780 (old), 780 (new), 0 (No change)
  • Drawable: 342 (old), 342 (new), 0 (No change)
  • Id: 1221 (old), 1221 (new), 0 (No change)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 343 (old), 343 (new), 0 (No change)
  • Menu: 1 (old), 1 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • String: 785 (old), 785 (new), 0 (No change)
  • Style: 472 (old), 472 (new), 0 (No change)
  • Xml: 1 (old), 1 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 11 MiB (old), 11 MiB (new), 108 bytes (Removed)
APK download size (estimated): 10 MiB (old), 10 MiB (new), 38 bytes (Removed)
Method count: 116265 (old), 116266 (new), 1 (Added)

Configuration hdpi

APK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change)
APK download size (estimated): 17 KiB (old), 17 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change)
APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change)
APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change)
APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change)
APK download size (estimated): 20 KiB (old), 20 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change)
APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change)
APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Beta

Expand to see flavor specifics

Universal APK

APK file size: 11 MiB (old), 11 MiB (new), 104 bytes (Added)

APK download size (estimated): 10 MiB (old), 10 MiB (new), 1731 bytes (Removed)

Method count: 116271 (old), 116272 (new), 1 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 5786 (old), 5786 (new), 0 (No change)

  • Anim: 33 (old), 33 (new), 0 (No change)
  • Animator: 24 (old), 24 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 888 (old), 888 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 820 (old), 820 (new), 0 (No change)
  • Dimen: 780 (old), 780 (new), 0 (No change)
  • Drawable: 342 (old), 342 (new), 0 (No change)
  • Id: 1221 (old), 1221 (new), 0 (No change)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 343 (old), 343 (new), 0 (No change)
  • Menu: 1 (old), 1 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • String: 785 (old), 785 (new), 0 (No change)
  • Style: 472 (old), 472 (new), 0 (No change)
  • Xml: 1 (old), 1 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 11 MiB (old), 11 MiB (new), 108 bytes (Added)
APK download size (estimated): 10 MiB (old), 10 MiB (new), 341 bytes (Removed)
Method count: 116271 (old), 116272 (new), 1 (Added)

Configuration hdpi

APK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change)
APK download size (estimated): 17 KiB (old), 17 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change)
APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change)
APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change)
APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change)
APK download size (estimated): 20 KiB (old), 20 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change)
APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change)
APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Ga

Expand to see flavor specifics

Universal APK

APK file size: 11 MiB (old), 11 MiB (new), 100 bytes (Removed)

APK download size (estimated): 10 MiB (old), 10 MiB (new), 229 bytes (Added)

Method count: 116271 (old), 116272 (new), 1 (Added)

Features: 2 (old), 2 (new), 0 (No change)

Permissions: 6 (old), 6 (new), 0 (No change)

Resources: 5786 (old), 5786 (new), 0 (No change)

  • Anim: 33 (old), 33 (new), 0 (No change)
  • Animator: 24 (old), 24 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 888 (old), 888 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 820 (old), 820 (new), 0 (No change)
  • Dimen: 780 (old), 780 (new), 0 (No change)
  • Drawable: 342 (old), 342 (new), 0 (No change)
  • Id: 1221 (old), 1221 (new), 0 (No change)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 343 (old), 343 (new), 0 (No change)
  • Menu: 1 (old), 1 (new), 0 (No change)
  • Mipmap: 1 (old), 1 (new), 0 (No change)
  • Plurals: 10 (old), 10 (new), 0 (No change)
  • String: 785 (old), 785 (new), 0 (No change)
  • Style: 472 (old), 472 (new), 0 (No change)
  • Xml: 1 (old), 1 (new), 0 (No change)

Lesson assets: 111 (old), 111 (new), 0 (No change)

AAB differences

Expand to see AAB specifics

Supported configurations:

  • hdpi (same)
  • ldpi (same)
  • mdpi (same)
  • tvdpi (same)
  • xhdpi (same)
  • xxhdpi (same)
  • xxxhdpi (same)

Base APK

APK file size: 11 MiB (old), 11 MiB (new), 96 bytes (Removed)
APK download size (estimated): 10 MiB (old), 10 MiB (new), 217 bytes (Removed)
Method count: 116271 (old), 116272 (new), 1 (Added)

Configuration hdpi

APK file size: 43 KiB (old), 43 KiB (new), 0 bytes (No change)
APK download size (estimated): 17 KiB (old), 17 KiB (new), 0 bytes (No change)

Configuration ldpi

APK file size: 44 KiB (old), 44 KiB (new), 0 bytes (No change)
APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration mdpi

APK file size: 38 KiB (old), 38 KiB (new), 0 bytes (No change)
APK download size (estimated): 13 KiB (old), 13 KiB (new), 0 bytes (No change)

Configuration tvdpi

APK file size: 73 KiB (old), 73 KiB (new), 0 bytes (No change)
APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

Configuration xhdpi

APK file size: 50 KiB (old), 50 KiB (new), 0 bytes (No change)
APK download size (estimated): 20 KiB (old), 20 KiB (new), 0 bytes (No change)

Configuration xxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change)
APK download size (estimated): 28 KiB (old), 28 KiB (new), 0 bytes (No change)

Configuration xxxhdpi

APK file size: 55 KiB (old), 55 KiB (new), 0 bytes (No change)
APK download size (estimated): 27 KiB (old), 27 KiB (new), 0 bytes (No change)

@adhiamboperes
Copy link
Collaborator

@adhiamboperes not sure why the Roboelectric tests failed, could you please help run it again?

> Process 'Gradle Test Executor 3' finished with non-zero exit value 134

Is typically a timeout error. I have re-run the tests, it should pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants