Skip to content

build: migrate unit test coverage from JaCoCo to Kover - #994

Merged
dkhawk merged 1 commit into
mainfrom
build/migrate-jacoco-to-kover
Sep 10, 2026
Merged

build: migrate unit test coverage from JaCoCo to Kover#994
dkhawk merged 1 commit into
mainfrom
build/migrate-jacoco-to-kover

Conversation

@kikoso

@kikoso kikoso commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrates unit test coverage from JaCoCo to kotlinx-kover 0.9.9.

Why: the jacocoTestReport task in PublishingConventionPlugin hardcoded AGP 9 internal intermediate paths (intermediates/built_in_kotlinc/debug) to work around JaCoCo not understanding the built-in Kotlin compiler output. Those paths are implementation details that can break on any AGP update. Kover (first-party JetBrains, actively maintained against AGP 9) integrates through AGP's variant APIs, so the manual report wiring is deleted. The unused com.mxalbert.gradle:jacoco-android classpath dependency (last released for AGP 8.x) is removed as well.

Changes

  • PublishingConventionPlugin applies org.jetbrains.kotlinx.kover with androidGeneratedClasses() excluded, replacing the hand-rolled jacocoTestReport task.
  • test.yml runs koverXmlReportDebug instead of jacocoTestReport.
  • Unchanged: the instrumented-test coverage in instrumentation-test.yml (createDebugCoverageReport on maps-app) uses AGP's built-in on-device JaCoCo, which Kover does not replace, so it stays as is.

Verification

Full CI command ./gradlew build koverXmlReportDebug -x :maps-app:generateDebugScreenshotTestConfig -x :maps-app:generateReleaseScreenshotTestConfig --stacktrace passes locally (11m 51s). Kover reports generate for all three library modules; maps-compose-utils (the only module with host unit tests) shows captured coverage, and the modules without host tests report 0% exactly as JaCoCo did.

@kikoso
kikoso requested a review from a team as a code owner September 10, 2026 12:53
Replaces the manual JaCoCo wiring in PublishingConventionPlugin with
kotlinx-kover 0.9.9. The old jacocoTestReport task hardcoded AGP 9
internal intermediate paths (intermediates/built_in_kotlinc) to work
around JaCoCo not understanding the built-in Kotlin compiler output;
Kover integrates through AGP's variant APIs so none of that is needed.

Also removes the unused com.mxalbert.gradle:jacoco-android classpath
dependency (last released for AGP 8.x).

CI now runs koverXmlReportDebug for the library modules. The
instrumented-test coverage in instrumentation-test.yml is unchanged:
it uses AGP's built-in on-device JaCoCo, which Kover does not cover.
@kikoso
kikoso force-pushed the build/migrate-jacoco-to-kover branch from aabb831 to a990ea6 Compare September 10, 2026 13:07
@googlemaps-bot

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 24.59%

There is no coverage information present for the Files changed

@dkhawk
dkhawk merged commit 2344932 into main Sep 10, 2026
13 checks passed
@dkhawk
dkhawk deleted the build/migrate-jacoco-to-kover branch September 10, 2026 17:28
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.

3 participants