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

Fix part of #5343: Generate Code Coverage Report in HTML and MARKDOWN formats #5443

Merged
merged 128 commits into from
Jun 28, 2024

Conversation

Rd4dev
Copy link
Collaborator

@Rd4dev Rd4dev commented Jun 24, 2024

Explanation

Fixes part of #5343

Project

[PR 1.5 of Project 4.1]

Changes Made

This PR introduces the CoverageReporter utility to generate the code coverage report. The main features and changes include:

  • New Utility:

    • CoverageReporter to generate code coverage reports.
  • Command Line Arguments:

    • Now support output formats: HTML or MARKDOWN.
  • Report Generation:

    • Generates coverage reports from the generated proto for the requested format.
    • Outputs are generated and stored in the coverage_reports folder relative to the repoRoot.
  • Gitignore Update:

    • The coverage_reports folder is added to .gitignore to ensure it is not added to the repository.

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 added 30 commits June 13, 2024 20:00
… file content and its related test content in the provided subpackage
…d test files with corresponding build configurations and content
@Rd4dev
Copy link
Collaborator Author

Rd4dev commented Jun 27, 2024

@adhiamboperes, the PR 1.5 tasks are done.

As of now the reports are returning a pair of computed coverage ratio and the actual report text.
And RunCoverage takes the report text and saves it to the output file (in location coverage_reports/.../coverage.md or .html)

M2
These report texts and computed coverage ratios are returned with the plan to make them useful in M2

  1. report text - to gather all the reports (failed) and upload them as a single comment
  2. computed coverage ratio - to check for minimum threshold to decide pass / fail case

with these plans, I have addressed the existing review comments, would it be possible to PTAL!

Base automatically changed from code_coverage_store_as_proto to develop June 27, 2024 08:31
Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rd4dev, PTAL at some comments that I have.

Copy link

oppiabot bot commented Jun 27, 2024

Unassigning @adhiamboperes since the review is done.

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more followups

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: 16 MiB (old), 16 MiB (new), 0 bytes (No change)

APK download size (estimated): 14 MiB (old), 14 MiB (new), 11 bytes (Added)

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

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

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

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

  • Anim: 49 (old), 49 (new), 0 (No change)
  • Animator: 20 (old), 20 (new), 0 (No change)
  • Array: 15 (old), 15 (new), 0 (No change)
  • Attr: 915 (old), 915 (new), 0 (No change)
  • Bool: 10 (old), 10 (new), 0 (No change)
  • Color: 911 (old), 911 (new), 0 (No change)
  • Dimen: 994 (old), 994 (new), 0 (No change)
  • Drawable: 373 (old), 373 (new), 0 (No change)
  • Id: 1206 (old), 1206 (new), 0 (No change)
  • Integer: 37 (old), 37 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 368 (old), 368 (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)
  • Raw: 2 (old), 2 (new), 0 (No change)
  • String: 805 (old), 805 (new), 0 (No change)
  • Style: 816 (old), 816 (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: 16 MiB (old), 16 MiB (new), 4 bytes (Removed)
APK download size (estimated): 14 MiB (old), 14 MiB (new), 42 bytes (Removed)

Configuration hdpi

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

Configuration ldpi

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

Configuration mdpi

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

Configuration tvdpi

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

Configuration xhdpi

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

Configuration xxhdpi

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

Configuration xxxhdpi

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

Alpha

Expand to see flavor specifics

Universal APK

APK file size: 10 MiB (old), 10 MiB (new), 0 bytes (No change)

APK download size (estimated): 9184 KiB (old), 9184 KiB (new), 21 bytes (Removed)

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

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

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

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

  • Anim: 39 (old), 39 (new), 0 (No change)
  • Animator: 18 (old), 18 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 879 (old), 879 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 767 (old), 767 (new), 0 (No change)
  • Dimen: 722 (old), 722 (new), 0 (No change)
  • Drawable: 333 (old), 333 (new), 0 (No change)
  • Id: 1148 (old), 1148 (new), 0 (No change)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 327 (old), 327 (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: 736 (old), 736 (new), 0 (No change)
  • Style: 457 (old), 457 (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: 9 MiB (old), 9 MiB (new), 0 bytes (No change)
APK download size (estimated): 9064 KiB (old), 9064 KiB (new), 16 bytes (Removed)

Configuration hdpi

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

Configuration ldpi

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

Configuration mdpi

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

Configuration tvdpi

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

Configuration xhdpi

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

Configuration xxhdpi

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

Configuration xxxhdpi

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

Beta

Expand to see flavor specifics

Universal APK

APK file size: 10 MiB (old), 10 MiB (new), 0 bytes (No change)

APK download size (estimated): 9169 KiB (old), 9169 KiB (new), 8 bytes (Added)

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

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

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

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

  • Anim: 39 (old), 39 (new), 0 (No change)
  • Animator: 18 (old), 18 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 879 (old), 879 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 767 (old), 767 (new), 0 (No change)
  • Dimen: 722 (old), 722 (new), 0 (No change)
  • Drawable: 333 (old), 333 (new), 0 (No change)
  • Id: 1148 (old), 1148 (new), 0 (No change)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 327 (old), 327 (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: 736 (old), 736 (new), 0 (No change)
  • Style: 457 (old), 457 (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: 9 MiB (old), 9 MiB (new), 0 bytes (No change)
APK download size (estimated): 9053 KiB (old), 9053 KiB (new), 4 bytes (Added)

Configuration hdpi

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

Configuration ldpi

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

Configuration mdpi

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

Configuration tvdpi

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

Configuration xhdpi

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

Configuration xxhdpi

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

Configuration xxxhdpi

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

Ga

Expand to see flavor specifics

Universal APK

APK file size: 10 MiB (old), 10 MiB (new), 0 bytes (No change)

APK download size (estimated): 9169 KiB (old), 9169 KiB (new), 0 bytes (No change)

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

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

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

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

  • Anim: 39 (old), 39 (new), 0 (No change)
  • Animator: 18 (old), 18 (new), 0 (No change)
  • Array: 14 (old), 14 (new), 0 (No change)
  • Attr: 879 (old), 879 (new), 0 (No change)
  • Bool: 8 (old), 8 (new), 0 (No change)
  • Color: 767 (old), 767 (new), 0 (No change)
  • Dimen: 722 (old), 722 (new), 0 (No change)
  • Drawable: 333 (old), 333 (new), 0 (No change)
  • Id: 1148 (old), 1148 (new), 0 (No change)
  • Integer: 32 (old), 32 (new), 0 (No change)
  • Interpolator: 11 (old), 11 (new), 0 (No change)
  • Layout: 327 (old), 327 (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: 736 (old), 736 (new), 0 (No change)
  • Style: 457 (old), 457 (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: 9 MiB (old), 9 MiB (new), 4 bytes (Removed)
APK download size (estimated): 9053 KiB (old), 9053 KiB (new), 9 bytes (Removed)

Configuration hdpi

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

Configuration ldpi

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

Configuration mdpi

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

Configuration tvdpi

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

Configuration xhdpi

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

Configuration xxhdpi

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

Configuration xxxhdpi

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

@Rd4dev
Copy link
Collaborator Author

Rd4dev commented Jun 28, 2024

Thanks for the review @adhiamboperes, addressed all the review comments and updated tests accordingly. Can you PTAL!

@oppiabot oppiabot bot assigned adhiamboperes and unassigned Rd4dev Jun 28, 2024
Copy link

oppiabot bot commented Jun 28, 2024

Unassigning @Rd4dev since a re-review was requested. @Rd4dev, please make sure you have addressed all review comments. Thanks!

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Rd4dev, LGTM!

@adhiamboperes
Copy link
Collaborator

@seanlip, could you PTAL? I have verified that @BenHenning's changes have been addressed.

Copy link

oppiabot bot commented Jun 28, 2024

Assigning @BenHenning for code owner reviews. Thanks!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for codeowners since Ben is away

@seanlip seanlip dismissed BenHenning’s stale review June 28, 2024 15:46

Dismissing per Adhiambo's confirmation, since Ben is away

@seanlip seanlip merged commit f53c7e5 into develop Jun 28, 2024
25 checks passed
@seanlip seanlip deleted the code_coverage_generate_report branch June 28, 2024 15:46
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.

4 participants