build: migrate unit test coverage from JaCoCo to Kover - #121
Merged
Conversation
Replaces the manual JaCoCo wiring in PublishingConventionPlugin with kotlinx-kover 0.9.9. The old jacocoTestReport task read classes from tmp/kotlin-classes/debug, a path that no longer exists with AGP 9's built-in Kotlin compiler, so the coverage report has been empty. Kover integrates through AGP's variant APIs and restores real numbers (the library currently reports 3.4% line coverage instead of an empty report). Also removes enableUnitTestCoverage from the library module: Kover attaches its own agent to unit test runs, so AGP's JaCoCo agent would double-instrument. enableAndroidTestCoverage stays for on-device coverage. CI now runs koverXmlReportDebug; madrapps/jacoco-report supports Kover XML natively, so only the report path changed and the coverage gates are untouched.
Contributor
Code Coverage
|
Fixes the zizmor mandatory-check failures on test.yml: - unpinned-uses: all five actions are now pinned to commit SHAs (checkout v6.1.0, setup-java v5.7.0, setup-gradle v6.3.0, jacoco-report v1.8.0, upload-artifact v7.0.1). This also bumps madrapps/jacoco-report from v1.7.2 to v1.8.0, the same pin the other googlemaps Android repos use. - template-injection: the coverage outputs are passed to the echo step through env vars instead of expanding directly in the run script.
Resolves the remaining zizmor excessive-permissions finding. The workflow defaults to contents: read; the test job additionally gets pull-requests: write so the coverage comment can be posted.
dkhawk
approved these changes
Sep 10, 2026
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
Migrates unit test coverage from JaCoCo to kotlinx-kover 0.9.9, matching googlemaps/android-maps-utils#1776 and googlemaps/android-maps-compose#994.
Why: the
jacocoTestReporttask inPublishingConventionPluginread classes fromtmp/kotlin-classes/debug, a path that no longer exists with AGP 9's built-in Kotlin compiler. The coverage report has therefore been empty. Kover integrates through AGP's variant APIs, so no internal paths are involved and real numbers are restored (the library currently reports 3.4% line coverage instead of an empty report).Changes
PublishingConventionPluginappliesorg.jetbrains.kotlinx.kover(withandroidGeneratedClasses()excluded) instead of the hand-rolledjacocoTestReporttask.places-compose: removesenableUnitTestCoverage. Kover attaches its own agent to unit test runs, so AGP's JaCoCo agent would double-instrument.enableAndroidTestCoveragestays for on-device coverage.test.yml: runskoverXmlReportDebugand pointsmadrapps/jacoco-report(which supports Kover XML natively) at the new report path. The coverage gates (26% overall / 60% changed files) are unchanged.Verification
Full CI command
./gradlew build koverXmlReportDebug --stacktracepasses locally. The generatedplaces-compose/build/reports/kover/reportDebug.xmlreports 16/472 lines covered (3.4%), where the previous JaCoCo setup produced an empty report.