build: migrate unit test coverage from JaCoCo to Kover - #1776
Closed
kikoso wants to merge 1 commit into
Closed
Conversation
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.
Contributor
Code Coverage
|
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.
Why:
com.mxalbert.gradle:jacoco-androidplugin is effectively unmaintained (last released for AGP 8.x), which forcedPublishingConventionPluginto 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.library,clustering,heatmaps) had no working coverage since their KMP migration:report.ymlpointed atjacoco.xmlfiles that were no longer generated. They now report coverage again.Changes
PublishingConventionPluginappliesorg.jetbrains.kotlinx.koverinstead ofcom.mxalbert.gradle.jacoco-androidand drops the JaCoCoclassDirectoriesworkaround.library,clustering,heatmaps(KMP): apply the Kover plugin directly; the "jacoco needs KMP-aware re-wiring" TODOs are resolved.data: removes the stale directjacocoplugin andjacocoDebugReporttask that still referenced the pre-AGP-9tmp/kotlin-classespath.test.yml,report.yml): runskoverXmlReportDebug(AGP modules) +koverXmlReportAndroid(KMP modules).madrapps/jacoco-reportsupports 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 --stacktracepasses locally (11m 49s). Line coverage per module from the generated Kover reports: