Skip to content

Exclude Compose previews from Jacoco reports#3584

Merged
shobhitagarwal1612 merged 3 commits into
masterfrom
exclude-preview
Feb 27, 2026
Merged

Exclude Compose previews from Jacoco reports#3584
shobhitagarwal1612 merged 3 commits into
masterfrom
exclude-preview

Conversation

@shobhitagarwal1612

@shobhitagarwal1612 shobhitagarwal1612 commented Feb 27, 2026

Copy link
Copy Markdown
Member

Adds ExcludeFromJacocoGeneratedReport annotation to all remaining compose previews.

@andreia-ferreira PTAL?

@auto-assign auto-assign Bot requested a review from hassan-nsubuga February 27, 2026 09:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to refine code coverage metrics by excluding UI preview functions from Jacoco reports. By annotating these functions, the project ensures that only production-relevant code contributes to the coverage percentage, leading to a more accurate representation of test coverage for the application's core logic.

Highlights

  • Jacoco Exclusion: Applied the ExcludeFromJacocoGeneratedReport annotation to all remaining Jetpack Compose @Preview functions to prevent them from being included in code coverage reports.
  • Import Statements: Added the necessary import statement for org.groundplatform.android.ui.common.ExcludeFromJacocoGeneratedReport in all affected files.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • app/src/main/java/org/groundplatform/android/ui/components/MapFloatingActionButton.kt
    • Imported ExcludeFromJacocoGeneratedReport.
    • Annotated MapFloatingActionButtonPreview with ExcludeFromJacocoGeneratedReport.
  • app/src/main/java/org/groundplatform/android/ui/components/RecenterButton.kt
    • Imported ExcludeFromJacocoGeneratedReport.
    • Annotated RecenterButtonPreview with ExcludeFromJacocoGeneratedReport.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/HomeScreenMapContainerScreen.kt
    • Imported ExcludeFromJacocoGeneratedReport.
    • Annotated HomeScreenMapContainerScreenPreview with ExcludeFromJacocoGeneratedReport.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobMapComponent.kt
    • Imported ExcludeFromJacocoGeneratedReport.
    • Annotated JobMapComponentPreview with ExcludeFromJacocoGeneratedReport.
  • app/src/main/java/org/groundplatform/android/ui/surveyselector/components/SurveyEmptyState.kt
    • Imported ExcludeFromJacocoGeneratedReport.
    • Annotated SurveyEmptyStatePreview with ExcludeFromJacocoGeneratedReport.
Activity
  • The author requested a review from a specific user.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request consistently adds the @ExcludeFromJacocoGeneratedReport annotation to various Jetpack Compose preview functions to exclude them from Jacoco code coverage reports. While this change is functional, I've suggested a more scalable approach in a comment to handle this project-wide, which would avoid the need for manual annotations in the future.

@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.09%. Comparing base (f415f48) to head (7dedfa9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3584      +/-   ##
============================================
+ Coverage     71.01%   71.09%   +0.07%     
  Complexity     1625     1625              
============================================
  Files           337      337              
  Lines          9106     9096      -10     
  Branches       1006     1001       -5     
============================================
  Hits           6467     6467              
+ Misses         2040     2030      -10     
  Partials        599      599              
Files with missing lines Coverage Δ
...m/android/ui/components/MapFloatingActionButton.kt 87.87% <ø> (+5.02%) ⬆️
...ndplatform/android/ui/components/RecenterButton.kt 94.44% <ø> (+9.44%) ⬆️
.../home/mapcontainer/HomeScreenMapContainerScreen.kt 67.18% <ø> (+2.03%) ⬆️
...droid/ui/home/mapcontainer/jobs/JobMapComponent.kt 72.05% <ø> (+2.05%) ⬆️
...d/ui/surveyselector/components/SurveyEmptyState.kt 93.33% <ø> (+10.98%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shobhitagarwal1612 shobhitagarwal1612 merged commit e8ede9e into master Feb 27, 2026
8 of 9 checks passed
@shobhitagarwal1612 shobhitagarwal1612 deleted the exclude-preview branch February 27, 2026 09:59
hassan-nsubuga pushed a commit to hassan-nsubuga/ground-android that referenced this pull request Mar 2, 2026
hassan-nsubuga added a commit that referenced this pull request Mar 2, 2026
* Add a conditional to e2e test

The CompleteAllTaskTypesTest didn't cover conditional logic. Added a conditional question to the test survey and added tests for it in order to prevent regressions

Closes #3481

* Reformat code

* Refactor to remove conditional test logic

* Refactor to seperate responsibility, move conditional test logic to DataCollectionRobot and add a reusable method to AndroidTestDriver

* Bump com.google.firebase:firebase-bom from 34.9.0 to 34.10.0 (#3582)

Bumps com.google.firebase:firebase-bom from 34.9.0 to 34.10.0.

---
updated-dependencies:
- dependency-name: com.google.firebase:firebase-bom
  dependency-version: 34.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Refactor settings screen to compose (#3574)

* Migrate SettingsActivity to compose
* Migrate SettingsFragment.kt to compose
* Update unit tests
* Remove unused strings
* Decouple data layer from SettingsViewModel

* Exclude Compose previews from Jacoco reports (#3584)

* Refactor show sign out confirmation dialogs (#3583)

* Bump org.mockito:mockito-bom from 5.21.0 to 5.22.0 (#3586)

Bumps [org.mockito:mockito-bom](https://github.com/mockito/mockito) from 5.21.0 to 5.22.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.21.0...v5.22.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-bom
  dependency-version: 5.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Rename variable to have a more conventional name

* Create MultipleChoiceType sealed class to represent the kind of multiple choice questions being handled, Refactor DataCollectionRobot to use the new sealed class

* Refactor to rename test constants to more descriptive names to give  context about the tests

* Reformat code to pass a code format check

* Refactor to make constant names descriptive

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Nsubuga <nsubugahassan@gmail.com>
Co-authored-by: Andreia Ferreira <51242456+andreia-ferreira@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shobhit Agarwal <ashobhit@google.com>
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