Skip to content

Recently Played Activity Test Slip#24

Open
Rd4dev wants to merge 3 commits into
developfrom
code_coverage_recently_played_activity_test_slip
Open

Recently Played Activity Test Slip#24
Rd4dev wants to merge 3 commits into
developfrom
code_coverage_recently_played_activity_test_slip

Conversation

@Rd4dev

@Rd4dev Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner

Explanation

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).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

@Rd4dev

Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner Author

Test File Check slips the incorrect path since it only compares via the presence of file names -

Test file name - PromotedStoryViewModelTest.kt and its expected computed file name - RecentlyPlayedActivityTest.kt
Test file name - PromotedStoryListViewModelTest.kt and its expected computed file name - RecentlyPlayedActivityTest.kt
Test file name - TopicSummaryViewModelTest.kt and its expected computed file name - RecentlyPlayedActivityTest.kt
Test file name - RecentlyPlayedActivityTest.kt and its expected computed file name - RecentlyPlayedActivityTest.kt

@Rd4dev

Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner Author

Actually its detected on transitive deps.

//app:src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedFragmentTest, 
//app:src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedActivityTest, 
//app:src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest,

@Rd4dev

Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner Author

If provided test file - The coverage run is skipped as the source file cannot be detected from the test file :

bazel run //scripts:run_coverage -- $(pwd) app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedActivityTest.kt
INFO: Analyzed target //scripts:run_coverage (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //scripts:run_coverage up-to-date:
  bazel-bin/scripts/run_coverage.jar
  bazel-bin/scripts/run_coverage.jdeps
INFO: Elapsed time: 1.466s, Critical Path: 1.33s
INFO: 3 processes: 1 internal, 1 linux-sandbox, 1 worker.
INFO: Build completed successfully, 3 total actions
INFO: Running command line: bazel-bin/scripts/run_coverage /home/rd/opensource/oppia-android app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedActivityTest.kt
Finding source file for - app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedActivityTest.kt
Possible source file paths - [app/src/main/java/org/oppia/android/app/home/RecentlyPlayedActivity.kt]
Does the possible file source exist - false
Running coverage analysis for the files: []
Using format: HTML

Coverage Analysis PASSED

@Rd4dev

Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner Author

Ah gotcha!

bazel run //scripts:run_coverage -- $(pwd) app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt
INFO: Analyzed target //scripts:run_coverage (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //scripts:run_coverage up-to-date:
  bazel-bin/scripts/run_coverage.jar
  bazel-bin/scripts/run_coverage.jdeps
INFO: Elapsed time: 0.128s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/scripts/run_coverage /home/rd/opensource/oppia-android app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt
Running coverage analysis for the files: [app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt]
Using format: HTML

-> The coverage analysis for  failed - reason: No appropriate test file found for app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt. 

  
  COVERAGE FAILURE REPORT:
  -----------------------
  Coverage Report Failure:
  ------------------------
  Test Target: 
  Failure Message: No appropriate test file found for app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt.

Exception in thread "main" java.lang.IllegalStateException: Coverage Analysis FAILED
	at org.oppia.android.scripts.coverage.RunCoverage.execute(RunCoverage.kt:178)
	at org.oppia.android.scripts.coverage.RunCoverageKt.main(RunCoverage.kt:110)

This is the reason.
When test file was provided via the PR it skipped the coverage check as a whole since it was not able to spot the appropriate source file.

Reason why it was meant in that way was the need to check against different modules : Maybe this can be set to throw an error if there is no source file mapping available - that could be a better check to this.

Ah the fail case...
When the source file was provided (ie. the changed file list of the coverage check - It fails.

Ok the real question is this should have failed in the run coverage -- right? and not in evaluate (that relates to pb files)

@Rd4dev

Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner Author

Wait what --

bazel run //scripts:run_coverage -- $(pwd) app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt --format=PROTO
INFO: Analyzed target //scripts:run_coverage (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //scripts:run_coverage up-to-date:
  bazel-bin/scripts/run_coverage.jar
  bazel-bin/scripts/run_coverage.jdeps
INFO: Elapsed time: 0.135s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/scripts/run_coverage /home/rd/opensource/oppia-android app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt '--format=PROTO'
Running coverage analysis for the files: [app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt]
Using format: PROTO
Possible Test file paths are - [app/src/sharedTest/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityTest.kt, app/src/test/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityTest.kt, app/src/test/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityLocalTest.kt]
rd@mint:~/opensource/oppia-android$ bazel run //scripts:run_coverage -- $(pwd) app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt --format=HTML
INFO: Analyzed target //scripts:run_coverage (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //scripts:run_coverage up-to-date:
  bazel-bin/scripts/run_coverage.jar
  bazel-bin/scripts/run_coverage.jdeps
INFO: Elapsed time: 0.117s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/scripts/run_coverage /home/rd/opensource/oppia-android app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt '--format=HTML'
Running coverage analysis for the files: [app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt]
Using format: HTML
Possible Test file paths are - [app/src/sharedTest/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityTest.kt, app/src/test/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityTest.kt, app/src/test/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityLocalTest.kt]

-> The coverage analysis for  failed - reason: No appropriate test file found for app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt. 

  
  COVERAGE FAILURE REPORT:
  -----------------------
  Coverage Report Failure:
  ------------------------
  Test Target: 
  Failure Message: No appropriate test file found for app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt.

Exception in thread "main" java.lang.IllegalStateException: Coverage Analysis FAILED
	at org.oppia.android.scripts.coverage.RunCoverage.execute(RunCoverage.kt:178)
	at org.oppia.android.scripts.coverage.RunCoverageKt.main(RunCoverage.kt:110)

The proto version gets past it while html throws error... 🫤

@Rd4dev

Rd4dev commented Mar 25, 2025

Copy link
Copy Markdown
Owner Author

Ok the black sheep was the PROTO format

@github-actions

Copy link
Copy Markdown

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), 4 bytes (Added)

APK download size (estimated): 17 MiB (old), 17 MiB (new), 16 bytes (Added)

Method count: 260454 (old), 260454 (new), 0 (No change)

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

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

Resources: 6832 (old), 6832 (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: 1285 (old), 1285 (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: 855 (old), 855 (new), 0 (No change)
  • Style: 832 (old), 832 (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), 4 bytes (Added)
APK download size (estimated): 17 MiB (old), 17 MiB (new), 26 bytes (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), 4 bytes (Added)

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

Method count: 115881 (old), 115881 (new), 0 (No change)

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

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

Resources: 5800 (old), 5800 (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: 1231 (old), 1231 (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: 788 (old), 788 (new), 0 (No change)
  • Style: 473 (old), 473 (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), 4 bytes (Added)
APK download size (estimated): 10 MiB (old), 10 MiB (new), 13 bytes (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), 4 bytes (Removed)

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

Method count: 115887 (old), 115887 (new), 0 (No change)

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

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

Resources: 5800 (old), 5800 (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: 1231 (old), 1231 (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: 788 (old), 788 (new), 0 (No change)
  • Style: 473 (old), 473 (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: 10 MiB (old), 10 MiB (new), 4 bytes (Removed)
APK download size (estimated): 9 MiB (old), 9 MiB (new), 14 bytes (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), 4 bytes (Added)

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

Method count: 115887 (old), 115887 (new), 0 (No change)

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

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

Resources: 5800 (old), 5800 (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: 1231 (old), 1231 (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: 788 (old), 788 (new), 0 (No change)
  • Style: 473 (old), 473 (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: 10 MiB (old), 10 MiB (new), 0 bytes (No change)
APK download size (estimated): 9 MiB (old), 9 MiB (new), 8 bytes (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)

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.

1 participant