https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
code-coverage
  • p

    pajatopmr

    11/08/2018, 9:38 AM
    My first attempt at using code coverage in a multiplatform library is up at https://github.com/pajato/ArgusCoreKML . Critiques and questions will be appreciated.
    • 1
    • 1
  • p

    pajatopmr

    12/18/2018, 1:29 AM
    btw, if anyone else is interested in collaborating on a solution to this problem, either DM me or start a thread.
    • 1
    • 2
  • p

    pajatopmr

    01/29/2019, 12:14 PM
    This is important and timely: https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1548681883151800
    j
    • 2
    • 4
  • s

    Steven

    06/13/2019, 4:43 PM
    Hi @Anthony f, it seems that when i use Intellij code coverage, it only works for one class at a time. If i try running all test classes at once, i will get 0% coverage everywhere
    a
    • 2
    • 1
  • j

    Joe

    06/21/2019, 5:49 PM
    Having a coverage question with respect to using the
    ?:
    elvis operator to provide a default: If I have code that does something like:
    val x = nullableObject?.method() ?: default
    JaCoCo tells me I have one of 4 branches uncovered. If I change that to:
    val nullableX = nullableObject?.method()
        val x = nullableX ?: default
    JaCoCo tells me all branches are covered (2 branches per line). I'm guessing the "uncovered" branch is when
    nullableObject
    is non-null, but
    method()
    returns null -- is there a way to get JaCoCo to realize that branch is not possible based on
    method()
    not being nullable? Or is there a better practice here?
    a
    • 2
    • 3
  • f

    fada21

    07/17/2019, 3:49 PM
    Can anyone share their configuration of jacoco (or any other tool) for Android project coverage reporting? What to look out for? I've seen some work being done for Kotlin support but not sure if it's worth investing time in (https://www.jacoco.org/jacoco/trunk/doc/changes.html)
    p
    • 2
    • 1
  • m

    miqbaldc

    10/28/2019, 2:57 PM
    anyone now about 991 development lifecycle?
    90% -> ci / build success rate
    90% -> code coverage
    under 10mins -> execution time
    I came accross it, when attending a local meetup, but I’m forgot to get the presentation slide, and after a while researching the web, the result seems not relevant.
    • 1
    • 1
  • a

    Antoine Gagnon

    03/09/2020, 3:22 PM
    Hey everyone, I’m having some hard time finding out at what point I should create the code coverage reports (probably with JaCoco), considering I’m using Github for version control, Sonarcloud for code analysis and Jenkins for CI, I’m not sure how to put those building blocks together
    j
    • 2
    • 4
  • j

    Jessica Barns

    03/30/2020, 7:40 PM
    Hi everyone, I’m currently doing research on which Code Coverage tool to use in a Kotlin Multiplatform Project (Android + iOS) to generate a Code Coverage report, but I don’t seem to find anything besides Jacoco, which would only work for the JVM. I want to be able to have the coverage for commonMain, androidMain and iosMain. Do you have any suggestion on how I could achieve that? Thank you!
    a
    d
    • 3
    • 3
  • p

    pajatopmr

    07/28/2020, 10:36 AM
    Ok folks. I've finally had enough. The code coverage situation in general is deplorable, for Kotlin it is even worse and for KMP worse still. So I am going to bite the bullet and take a few months to, hopefully, kickstart a new code coverage tool, an open source project that treats KMP as a first class citizen and any language that has a Language Server Protocol implementation reasonably well. The tool be source based (use a source-source transformation) thus eliminating the myriad problems caused by code generation tools with Jacoco and other current object based instances. Jetpack Compose doesn't stand a prayer with Jacoco based on my early experiences instrumenting the JetNews sample app. For now, I will call this tool CCT (names are not my forte). I will be asking lots of questions in this channel about Kotlin of course. If you have opinions, comments, observations, questions ... the thread awaits them.
    👍 2
    • 1
    • 1
  • p

    pajatopmr

    07/28/2020, 5:41 PM
    I recently generated a Jacoco (0.8.5) code coverage report for the Jetpack Compose sample app, JetNews, and
    lateinit
    was marked in yellow. Hovering revealed both cases were missed. I seem to recall not seeing this behavior in less experimental code. Two questions: 1) is Jacoco doing the right thing for your uses of
    lateinit
    statements? 2) should the code coverage tool even care about
    lateinit
    ? I think not because it is the accesses that are relevant and important to execute. Note that code coverage is not the right tool to ensure that using un-initialized variables are caught. That state can happen at runtime and be missed by a 100% code coverage run. Therefore knowing that no test tripped an un-initialised execution is not helpful.
    • 1
    • 1
  • e

    Evan

    02/09/2021, 12:12 AM
    Does anyone have a guide for how to enable code coverage, either from jacoco or IntelliJ, for a Kotlin Multiplatform project? I seem to only find conflicting/out of date resources and I’m really struggling here.
    a
    • 2
    • 6
  • m

    Mark Allanson

    05/26/2021, 6:55 PM
    Anyone experienced
    java.lang.IllegalStateException: Unexpected SMAP line: *S KotlinDebug
    when generating Jacoco coverage reports with Kotlin 1.5.0?
    j
    • 2
    • 3
  • g

    glenkpeterson

    05/31/2021, 4:02 PM
    Anyone else lost code coverage highlighting in IntelliJ after upgrading to Kotlin 1.5.10 (from 1.4.21)? I opened an issue, but will close it if I just did something dumb: https://youtrack.jetbrains.com/issue/KT-47057
    h
    • 2
    • 1
  • m

    Matthias Geisler

    09/08/2021, 7:52 PM
    Hey People - I just read the Program of Kotlin 2021 Premier Online Event. However I stumbled over Kover. Since I currently develop a Coverage Plugin for Multiplatform (currently it's working for Android and JVM and iOS is on it's way)...I am of course super curious about, which cases Kover will cover and if I can spare my time and move on to another topic. Can anybody leak some information in this regard?
    g
    c
    +4
    • 7
    • 16
  • r

    Richard Schilling

    11/04/2021, 11:40 PM
    Hello everyone. People in this group might know the answer to this simple question. I’m looking for some good CASE tools or software architecture tools that convert system diagrams into Kotlin code. Does anyone have any recommendations?
    c
    • 2
    • 1
  • a

    Alejandro Rios

    11/17/2021, 8:36 PM
    Hello, I’m trying to use Kover in my project, but when I use
    ./gradlew koverHtmlReport
    runs the test for all the variants, how can I run Kover just for my tests in develop variant?
    g
    • 2
    • 3
  • j

    Javier

    11/20/2021, 1:15 PM
    anyone is using kover + sonarqube?
    m
    m
    • 3
    • 2
  • t

    Tomáš Hubálek

    01/19/2022, 11:08 AM
    Hi, I’m trying to use
    kover
    for my android project. For regular jUnit tests it works fine but I don’t see any results for tests run via
    ./gradlew connectedAndroidTest
    Is that supported? Is it necessary to configure it somehow?
    • 1
    • 1
  • l

    Landry Norris

    03/02/2022, 8:49 PM
    I'm using kotlinx-kover for code coverage in a project. I am using interfaces to maximize code reuse. I'm seeing something strange in one of my projects. I have the following interfaces that add convenient members (LogicGate is another interface)
    interface SingleOutput: LogicGate {
        val output: Pin
            get() = outputs.first()
    }
    interface SingleInput: LogicGate {
        var input
            get() = inputs.first()
            set(value) { inputs[0] = value }
    }
    I generally implement Input first, then Output, but when I do that, kover shows that the line that says
    interface SingleOutput: LogicGate
    is not run. I had to switch the order of imports for one of my classes in order for the line to show as Green in kover's report. Is this expected, or a bug in kover?
    p
    c
    v
    • 4
    • 8
  • a

    Andrew O Hart

    03/09/2022, 10:54 AM
    Has anybody managed to get Jacoco working on gradle 7? I keep getting failures when I run the jacocoTestReport task but it doesn't really tell me what? I'm trying to use it with Sonarqube for my JenkinsFile which will build it on Jenkins. Worked on our old non gradle 7 project but I'm not sure what the problem here is. Is there any examples of it with a KMM project for android/ios that anyboy knows of? Just reading here and sounds like Kover could be a good use case?
    m
    • 2
    • 13
  • k

    Klitos Kyriacou

    03/10/2022, 10:38 AM
    What is the latest preferred way of dealing with JaCoCo and
    @Serializable
    classes? I see several StackOverflow questions and answers that are 3+ years old, and there is a still outstanding issue 961. Has anyone solved the problem satisfactorily?
    m
    t
    • 3
    • 7
  • k

    Klitos Kyriacou

    03/13/2022, 7:57 PM
    Wherever I call bufferedWriter(), JaCoCo complains that one of two branches is missed. I presume this is because it's an inline function that calls
    writer().buffered()
    which are both also inline, and the call boils down to something similar to this:
    val x = OutputStreamWriter(this)
    return if (x is BufferedWriter) x else BufferedWriter(x)
    Now we know that the
    if
    true branch will never be called in this case, so there is nothing we can do in our own code to test this branch. Is there a way to silence JaCoCo from outputing this false positive?
    m
    • 2
    • 4
  • k

    kenkyee

    03/16/2022, 6:04 PM
    Isn't Kover supposed to handle these Kotlin edge-cases that Jacoco couldn't? Not sure why it thinks the object line needs testing when I accessed a constant in the object...
    f
    d
    • 3
    • 4
  • a

    Alina Dolgikh [JB]

    05/12/2022, 2:31 PM
    📣 Hi everyone! Please share what you think about the Kover code coverage tool by taking this short 10-question survey. 🎁 3 lucky survey respondents will win prizes! 🙂
    👍 4
    m
    d
    • 3
    • 2
  • g

    Gopal S Akshintala

    05/14/2022, 12:35 PM
    I am using Kover with INTELLIJ agent. Does anyone know how to feed the xml report to Sonarqube? (similar to
    sonar.coverage.jacoco.xmlReportPaths
    ) ?
    j
    • 2
    • 9
  • d

    darkmoon_uk

    06/18/2022, 4:24 AM
    Can Kover be applied to Android Connected/Instrumented UI tests?
    :plus-one: 1
    s
    t
    k
    • 4
    • 6
  • e

    Erick Sanchez

    06/29/2022, 6:25 PM
    Hi team!! Can you help me! Im using Kover and for some reason the Companion Object its not covered, some idea of how do it ??
    d
    l
    • 3
    • 2
  • v

    Vivek Modi

    07/12/2022, 10:12 AM
    Hey guys, I am getting weird issue when running on my unit test. I have this function
    internal fun getPendingStatusAction(
    status: XYZ
    ): (() -> Unit)? {
        var action: (() -> Unit)? = null
        this.yo = yo
        if (isAwaitingIdVerification(status)) {
            action = {
                <http://router.xyz|router.xyz>()
            }
        } else if (status == XYZ.PURCHASE) {
            action = {
                <http://router.xyz|router.xyz>()
            }
        }
        return action
    }
    When I run single unit test it complete fine, but when I run whole file unit test it failed.
    d
    k
    • 3
    • 12
  • d

    Didier Villevalois

    08/11/2022, 12:29 PM
    Hi all! I am setting up Kover on my (multi-project) open-source project, hosted on GitHub. Does anyone have a recommendation as to a GitHub application that can be fed my xml coverage report? I would like to have reports integrated to Pull Requests conversations and checks. Thank you all for your help!
    s
    m
    • 3
    • 3
Powered by Linen
Title
d

Didier Villevalois

08/11/2022, 12:29 PM
Hi all! I am setting up Kover on my (multi-project) open-source project, hosted on GitHub. Does anyone have a recommendation as to a GitHub application that can be fed my xml coverage report? I would like to have reports integrated to Pull Requests conversations and checks. Thank you all for your help!
@Sam I know my question may not be related to Kotlin itself, but it is related to Kover. Indeed, I have noticed some reported problems with Kover generated XML reports and Coveralls. So I guess it makes sense to ask people to share their experiences with different providers.
s

Sam

08/14/2022, 3:23 PM
Ah fair enough, I've had no issue feeding the reports into SonarCloud, I use bitbucket but I'm sure the GitHub integration is good
m

Michael Kaserer

08/20/2022, 7:43 PM
I just created this Github action that posts a codeverage report to your PRs as comment: https://github.com/mi-kas/kover-report
View count: 36