https://kotlinlang.org logo
#code-coverage
Title
# code-coverage
j

jQrgen

03/15/2024, 3:48 AM
Any template for displaying Kover code coverage in GitLab MRs?
c

CLOVIS

03/20/2024, 9:11 AM
🙌 1
This entire repository is a template project for Kotlin Multiplatform apps/libs with Gradle and fully configured CI (it's very opinionated).
j

jQrgen

03/20/2024, 1:59 PM
Does it only work for the JVM target?
c

CLOVIS

03/20/2024, 2:00 PM
Yes, Kover only works for the JVM target (for now?)
To see the generated HTML coverage report: • go to the job's page (https://gitlab.com/opensavvy/playgrounds/gradle/-/jobs/6432169232) • on the right side, click 'browse' • navigate to the index.html file • go through the redirection to GitLab Pages • you end up here: https://opensavvy.gitlab.io/-/playgrounds/gradle/-/jobs/6432169232/artifacts/jvm-cover-report/index.html (it's normal that it's empty in this project)
j

jQrgen

03/20/2024, 2:06 PM
Okay because I could get jvm+android+common uploaded here: https://wallywallet.gitlab.io/android/
But the coverage is not displayed in the GitLab UI in any way
c

CLOVIS

03/20/2024, 2:07 PM
Android counts as JVM so it should work as well
Ah, yes, please follow https://gitlab.com/opensavvy/playgrounds/gradle/-/issues/36 for visualisation directly in the code, I haven't done it yet. I'm hoping to do it somewhere around next week
j

jQrgen

03/20/2024, 2:07 PM
Or... actually I can get the percentage displayed
Okay nice
c

CLOVIS

03/20/2024, 2:08 PM
The percentage should be displayed right under the "merge" button with what my setup: https://gitlab.com/opensavvy/playgrounds/gradle/-/merge_requests/55/diffs?commit_id=b480d99e225c57c5b61f8a38baa446c8bfcb91ce (it won't show in this specific project because it's an empty template, but I tested it and this setup does work)
j

jQrgen

03/20/2024, 2:19 PM
Yeah, we have that, too, missing the test coverage visualization. Same as your #36
👍 1
c

CLOVIS

03/20/2024, 2:20 PM
I tried to get it working about a year ago but didn't manage at the time. I'm planning on trying again soon™
👀 1
14 Views