Skip to content

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

Closed
kikoso wants to merge 1 commit into
feat/experimental-kmp-clusteringfrom
build/migrate-jacoco-to-kover
Closed

build: migrate unit test coverage from JaCoCo to Kover#1776
kikoso wants to merge 1 commit into
feat/experimental-kmp-clusteringfrom
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 com.mxalbert.gradle:jacoco-android plugin is effectively unmaintained (last released for AGP 8.x), which forced PublishingConventionPlugin to hardcode internal AGP intermediate paths (intermediates/built_in_kotlinc/debug) to pick up classes from AGP 9's built-in Kotlin compiler. Kover integrates through AGP's variant APIs, so all of that workaround code is deleted.
  • Kover supports Kotlin Multiplatform natively. The KMP modules (library, clustering, heatmaps) had no working coverage since their KMP migration: report.yml pointed at jacoco.xml files that were no longer generated. They now report coverage again.
  • Kover filters compiler-generated code, so percentages reflect hand-written Kotlin. Expect a shift versus historical JaCoCo numbers on the first PRs after this merges.

Changes

  • PublishingConventionPlugin applies org.jetbrains.kotlinx.kover instead of com.mxalbert.gradle.jacoco-android and drops the JaCoCo classDirectories workaround.
  • library, clustering, heatmaps (KMP): apply the Kover plugin directly; the "jacoco needs KMP-aware re-wiring" TODOs are resolved.
  • data: removes the stale direct jacoco plugin and jacocoDebugReport task that still referenced the pre-AGP-9 tmp/kotlin-classes path.
  • CI (test.yml, report.yml): runs koverXmlReportDebug (AGP modules) + koverXmlReportAndroid (KMP modules). madrapps/jacoco-report supports Kover XML natively, so only the report paths changed; the coverage gates (26% overall / 60% changed files) are unchanged.

Verification

Full CI command ./gradlew build koverXmlReportDebug koverXmlReportAndroid --stacktrace passes locally (11m 49s). Line coverage per module from the generated Kover reports:

Module Coverage Note
library 91.3% restored (was missing since KMP migration)
heatmaps 87.0% restored
ui 77.7%
data 49.5%
clustering 31.4% restored

Replaces the unmaintained com.mxalbert.gradle:jacoco-android plugin
(last released for AGP 8.x) and the hand-rolled JaCoCo report wiring
with kotlinx-kover 0.9.9, which supports AGP 9's built-in Kotlin
compiler and Kotlin Multiplatform natively.

- PublishingConventionPlugin now applies Kover instead of JaCoCo,
  dropping the classDirectories workaround that pointed at internal
  AGP intermediate paths.
- The KMP modules (library, clustering, heatmaps) get coverage again:
  it had been silently missing since their KMP migration because the
  old jacoco.xml report paths were no longer generated.
- data: removed the stale direct jacoco plugin and jacocoDebugReport
  task that still referenced the pre-AGP-9 tmp/kotlin-classes path.
- CI now runs koverXmlReportDebug (AGP modules) and
  koverXmlReportAndroid (KMP modules); report.yml points
  madrapps/jacoco-report (which supports Kover XML) at the new
  report paths.
@googlemaps-bot

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 50.68% 🍏

There is no coverage information present for the Files changed

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