RFC - feat: add Android native code coverage support#124
Draft
mfazekas wants to merge 3 commits into
Draft
Conversation
Add @react-native-harness/coverage-android package with JaCoCo offline instrumentation. A Gradle init script instruments Kotlin/Java classes at build time, and the coverage collector pulls .ec files from the device and generates lcov reports at test time.
|
@mfazekas is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
- Use allprojects+afterEvaluate instead of projectsEvaluated (too late for source sets)
- Use configureEach for lazily-registered compile tasks
- Fix manifest template to use double-quoted string for ${applicationId}
- Remove redundant BuildConfig guard from CoverageHelper
- Set jacocoCli transitive=false
- Remove ANDROID_COVERAGE_GUIDE.md from repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
@react-native-harness/coverage-androidpackage for collecting Kotlin/Java code coverage from Android apps during harness test runs, using JaCoCo offline instrumentation.packages/coverage-android/package with Gradle init script, runtime helpers (CoverageHelper + CoverageInitProvider), and jacoco-agent.propertiesplatform-androidpulls.ecfiles via adb, merges with jacococli.jar (stashed during build), generates XML, converts to lcovcoverage.native.android.modulesSee
ANDROID_COVERAGE_GUIDE.mdfor usage instructions.Test plan
--init-scriptand verify$jacocoInitin class files--coverage --harnessRunner androidnative-coverage.lcovoutput with non-zero coverage