-
Notifications
You must be signed in to change notification settings - Fork 532
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 #5343: Implement script to run code coverage for a specific file #5433
Conversation
… file content and its related test content in the provided subpackage
…d test files with corresponding build configurations and content
…the contents as byte array
…eturning coverage data
… arguments and use them
…e in testing the utilities
…o code_coverage_bazel_command_execution
…o code_coverage_bazel_command_execution
…instead of test target
…o code_coverage_bazel_command_execution
…b.com/Rd4dev/oppia-android into code_coverage_bazel_command_execution
…b.com/oppia/oppia-android into code_coverage_using_filename
scripts/src/java/org/oppia/android/scripts/coverage/BUILD.bazel
Outdated
Show resolved
Hide resolved
scripts/src/java/org/oppia/android/scripts/coverage/RunCoverage.kt
Outdated
Show resolved
Hide resolved
APK & AAB differences analysisNote that this is a summarized snapshot. See the CI artifacts for detailed differences. DevExpand to see flavor specificsUniversal APKAPK file size: 16 MiB (old), 16 MiB (new), 96 KiB (Removed) APK download size (estimated): 14 MiB (old), 14 MiB (new), 89 KiB (Removed) Method count: 226905 (old), 221791 (new), 5114 (Removed) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 6550 (old), 6550 (new), 0 (No change)
Lesson assets: 111 (old), 105 (new), 6 (Removed):
AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 16 MiB (old), 15 MiB (new), 96 KiB (Removed) Configuration hdpiAPK file size: 59 KiB (old), 59 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 56 KiB (old), 56 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 53 KiB (old), 53 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 102 KiB (old), 102 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 67 KiB (old), 67 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 76 KiB (old), 76 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 79 KiB (old), 79 KiB (new), 0 bytes (No change) AlphaExpand to see flavor specificsUniversal APKAPK file size: 10 MiB (old), 10 MiB (new), 37 KiB (Removed) APK download size (estimated): 9183 KiB (old), 9150 KiB (new), 33 KiB (Removed) Method count: 101341 (old), 99436 (new), 1905 (Removed) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 5504 (old), 5504 (new), 0 (No change)
Lesson assets: 111 (old), 105 (new), 6 (Removed):
AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 9 MiB (old), 9 MiB (new), 37 KiB (Removed) Configuration hdpiAPK file size: 52 KiB (old), 52 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 52 KiB (old), 52 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 46 KiB (old), 46 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 90 KiB (old), 90 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 60 KiB (old), 60 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 69 KiB (old), 69 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 71 KiB (old), 71 KiB (new), 0 bytes (No change) BetaExpand to see flavor specificsUniversal APKAPK file size: 10 MiB (old), 9 MiB (new), 37 KiB (Removed) APK download size (estimated): 9168 KiB (old), 9135 KiB (new), 32 KiB (Removed) Method count: 101341 (old), 99436 (new), 1905 (Removed) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 5504 (old), 5504 (new), 0 (No change)
Lesson assets: 111 (old), 105 (new), 6 (Removed):
AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 9 MiB (old), 9 MiB (new), 37 KiB (Removed) Configuration hdpiAPK file size: 52 KiB (old), 52 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 52 KiB (old), 52 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 46 KiB (old), 46 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 90 KiB (old), 90 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 60 KiB (old), 60 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 69 KiB (old), 69 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 71 KiB (old), 71 KiB (new), 0 bytes (No change) GaExpand to see flavor specificsUniversal APKAPK file size: 10 MiB (old), 9 MiB (new), 37 KiB (Removed) APK download size (estimated): 9168 KiB (old), 9136 KiB (new), 32 KiB (Removed) Method count: 101341 (old), 99436 (new), 1905 (Removed) Features: 2 (old), 2 (new), 0 (No change) Permissions: 6 (old), 6 (new), 0 (No change) Resources: 5504 (old), 5504 (new), 0 (No change)
Lesson assets: 111 (old), 105 (new), 6 (Removed):
AAB differencesExpand to see AAB specificsSupported configurations:
Base APKAPK file size: 9 MiB (old), 9 MiB (new), 37 KiB (Removed) Configuration hdpiAPK file size: 52 KiB (old), 52 KiB (new), 0 bytes (No change) Configuration ldpiAPK file size: 52 KiB (old), 52 KiB (new), 0 bytes (No change) Configuration mdpiAPK file size: 46 KiB (old), 46 KiB (new), 0 bytes (No change) Configuration tvdpiAPK file size: 90 KiB (old), 90 KiB (new), 0 bytes (No change) Configuration xhdpiAPK file size: 60 KiB (old), 60 KiB (new), 0 bytes (No change) Configuration xxhdpiAPK file size: 69 KiB (old), 69 KiB (new), 0 bytes (No change) Configuration xxxhdpiAPK file size: 71 KiB (old), 71 KiB (new), 0 bytes (No change) |
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 @Rd4dev! Just had a couple of comments.
Note that I'm approving the PR, but please have @adhiamboperes verify the last couple comments before merging (just to make sure it's reviewed by someone).
scripts/src/javatests/org/oppia/android/scripts/coverage/RunCoverageTest.kt
Outdated
Show resolved
Hide resolved
scripts/src/java/org/oppia/android/scripts/coverage/RunCoverage.kt
Outdated
Show resolved
Hide resolved
scripts/src/javatests/org/oppia/android/scripts/coverage/RunCoverageTest.kt
Outdated
Show resolved
Hide resolved
scripts/src/java/org/oppia/android/scripts/common/BazelClient.kt
Outdated
Show resolved
Hide resolved
Also well done on getting this branched onto develop correctly @Rd4dev. :) |
Assigning @adhiamboperes for code owner reviews. Thanks! |
Thank you so much @BenHenning, will make sure to request @adhiamboperes on any further progress. |
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 @Rd4dev! I have take a full pass, and resolved the remaining comments. LGTM!
Synced with develop and enabling auto-merge. |
Explanation
Fixes part of #5343
Project
[PR 1.3 of Project 4.1]
Changes Made
RunCoverage.kt
that takes a filename as an argument.Implementation Details
Exemption Check: The script first checks if the provided file is exempted from having test file. If exempted, it exits early with the message "The file is exempted hence no coverage!".
Test Target Mapping:
test
andLocaltests
.Code Coverage Execution:
RunCoverageForTestTarget
script to execute code coverage analysis.Example Usage
bazel run //scripts:run_coverage -- $(pwd) utility/src/main/java/org/oppia/android/util/parser/math/MathModel.kt
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: