Skip to content

test: fix native coverage upload (again), and fail codecov if native upload fails#9059

Merged
mikehardy merged 3 commits into
mainfrom
continued-coverage-enhancements
Jun 21, 2026
Merged

test: fix native coverage upload (again), and fail codecov if native upload fails#9059
mikehardy merged 3 commits into
mainfrom
continued-coverage-enhancements

Conversation

@mikehardy

Copy link
Copy Markdown
Collaborator

Description

I am not concerned (yet) with native coverage not having high percentages, but I just finished overhauling native coverage in general, and now upload in specific, and I want a clear signal if native coverage generation -> dump -> process -> upload is failing

Related issues

No issues but is a continuation of this PR:

Release Summary

two test comments === no release

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

If you go on codecov.io and see line coverage information in packages/**/android and packages/**/ios then this is working

If there is a pull request where there is no coverage for those and it fails the codecov check, then it is also working


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@mikehardy mikehardy added the Workflow: Pending Merge Waiting on CI or similar label Jun 20, 2026
@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 refines the native code coverage pipeline for Android and iOS. By moving the coverage flush logic into the application process via a dedicated native module, it resolves long-standing issues where coverage data was lost due to process termination during test teardown. Additionally, it improves Codecov integration by defining explicit components for native coverage, providing a clearer signal for CI success or failure.

Highlights

  • Native Coverage Infrastructure: Overhauled the native coverage collection process for both Android and iOS to ensure reliable data flushing and upload signaling.
  • Android Coverage Flush: Implemented a new RNFBTestingCoverageModule for Android to manually trigger Jacoco coverage data dumps from the app process, replacing the unreliable instrumentation-based dump.
  • Codecov Integration: Updated codecov.yml to include path-based native coverage gates, ensuring that native coverage uploads are correctly tracked and enforced as components.
  • Documentation Updates: Extensively updated coverage-design.md and android.md to reflect the new pipeline, critical invariants, and troubleshooting steps for native coverage.
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 the 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 counterproductive. 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.

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[bot]

This comment was marked as resolved.

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.86%. Comparing base (de48420) to head (faf4cce).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9059      +/-   ##
============================================
- Coverage     61.38%   60.86%   -0.51%     
- Complexity        0     1602    +1602     
============================================
  Files           286      455     +169     
  Lines         14494    33589   +19095     
  Branches       3047     5405    +2358     
============================================
+ Hits           8895    20441   +11546     
- Misses         5515    11976    +6461     
- Partials         84     1172    +1088     
Flag Coverage Δ
android-native 48.55% <ø> (?)
e2e-ts-android 48.55% <ø> (?)
e2e-ts-ios 51.55% <ø> (?)
e2e-ts-macos 25.65% <ø> (?)
ios-native 51.55% <ø> (?)
jest 62.25% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy
mikehardy force-pushed the continued-coverage-enhancements branch from b096774 to b444313 Compare June 20, 2026 22:07
this is a known Detox issue, there are various ways to mitigate it,
but reaching in and just directly patching it to wait for 20s vs 10s
before failing seems adequate given the low frequency of this one
native coverage was still failing to upload correctly, and it was a silent
false positive

this doesn't enforce a specific level of native coverage but enforces that it
is correctly collected and uploaded - that the plumbing + system is working
@mikehardy
mikehardy force-pushed the continued-coverage-enhancements branch from b444313 to faf4cce Compare June 20, 2026 23:11
@mikehardy
mikehardy merged commit 74ddc9e into main Jun 21, 2026
22 checks passed
@mikehardy
mikehardy deleted the continued-coverage-enhancements branch June 21, 2026 02:36
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label Jun 21, 2026
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