https://kotlinlang.org logo
Join SlackCommunities
Powered by
# code-coverage
  • z

    Zach Olbrys

    09/26/2023, 12:36 PM
    in the main module
  • c

    czuckie

    11/23/2023, 9:09 AM
    will kover ever actually support android instrumented tests?
    p
    • 2
    • 4
  • k

    kv

    01/10/2024, 11:21 PM
    Hi all. Is there a way of excluding nested/local functions from being reported on Jacoco?
  • x

    xdevil666

    01/11/2024, 12:34 PM
    Hi folks I am working on a multi-module project in Android with groovy gradle. I was using jacoco 0.8.7 with AGP 7.0.4. now I have upgraded my AGP to 8.2 and Jacoco to 0.8.11 but now , unit and ui test cases are working fine but combined report doesn't include the ui coverage data. I am getting warning like
    Copy code
    [Ant:jacocoReport] Classes in bundle app do not match with execution data. For report generation the same class files must be used as at run time
    Please suggest me how can I fix this issue to get overall coverage. Question: Do I need to fix this warning or do I need to implement other library or plugin? If needed I can share my jacoco.gradle file too...
  • t

    Tiago

    01/16/2024, 3:05 PM
    hello all anyone here using Kover that could help with some issues? so when I am using a data class, Kover reports missing coverage (image-1) but if I change to a normal class, it reports 100% coverage (image-2) how could I workaround or fix this?
    • 1
    • 1
  • p

    pernilla

    01/16/2024, 5:20 PM
    Hello! Anyone experienced specific performance related issues with kover in a multimodule android project? We have about 10-15 modules being referenced from the app where we provide: project(:domain) kover(:domain) …. for all sub modules. Running the command locally takes approx at moste 5-6 minutes on the slowest computer among us developers whereas on the server (azure pipeline with default agent setup with ubuntu-latest) the same command time out after 45-50 minutes. We’re running this command:
    Copy code
    ./gradle koverXmlReportDebug
  • p

    pajatopmr

    01/28/2024, 4:03 PM
    I see that JetBrains Compose is making good progress in the KMP context. Can anyone attest to progress using Kover with JetBrains Compose over JetPack Compose?
  • m

    marco.lied

    02/01/2024, 7:40 AM
    Hi everyone, does anyone know, how I can exclude generated inner classes which are only numbers? Like
    $x$1
    ,
    $x$1$1
    ,
    $y$1$2
    etc., but keeping all “normal” inner classes which don’t have the numeric names?
    "*\$*\$*"
    doesn’t seem to work Same for
    $x$DefaultImpls
    where
    "*\$DefaultImpls"
    doesn’t seem to work either
    c
    • 2
    • 2
  • s

    Shervin

    03/04/2024, 4:58 PM
    Hey everyone, While running code coverage I see all lines of a Kotlin sealed
    object
    are covered except the first line, the definition of the class: so
    object MyObject : Person()
    is not covered, while all the inner children are covered. Any idea how I can resolve this?
    k
    c
    • 3
    • 8
  • j

    jQrgen

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

    CLOVIS

    04/13/2024, 7:19 PM
    Kover since 0.8.0 is marked as "0.8.0-beta". To clarify, is Kover 0.8.0-beta "more beta" than 0.7.0, or is it just that the naming scheme has changed and all pre-1.0.0 releases are now marked with -beta?
    c
    j
    • 3
    • 5
  • p

    pajatopmr

    04/19/2024, 1:44 PM
    I have just posted this message to #serialization about covering a serializable data class containing a List property that might be of interest to coverage caring coders...
  • c

    CLOVIS

    05/12/2024, 11:18 AM
    What's the missing code path here?
    j
    • 2
    • 4
  • h

    hfhbd

    05/21/2024, 10:34 AM
    Hey, I use kover and I have a multi module JVM project with jvm-test-suites. How can I disable running the integration tests when running koverVerify? I already tried excludedSourceSets.
    ✅ 1
    • 1
    • 1
  • m

    mudasar187

    05/24/2024, 6:07 PM
    Hey, I use kover and I like it much better than JaCoCo because it actually make it more clear about the coverage report on my Ktor project. But I see one issue (if its a issue). But when i run my tests I get following: First image where you can see that its marked twice. One with
    *Kt
    and one without. When I look into my file
    FtpService
    I see all my code is marked green (yeey!) but when I open
    FtpServiceKt
    the only line marked is the second image as you can see. Is that normal behavior or is there anything I can do to fix it?
    g
    • 2
    • 3
  • c

    CLOVIS

    06/02/2024, 5:17 PM
    What's considered best practice to deal with code paths that are expected to be impossible, but have an error message just in case they actually happen? I can't actually write a test to cover that part of the program, since I'm pretty sure it's impossible to reach. I still want to have a proper error message in case I'm wrong, though.
    p
    • 2
    • 6
  • p

    Peter

    06/03/2024, 11:13 AM
    Does anyone know why
    koverXmlReportRelease
    doesn't generate merged xml report, but
    koverXmlReport
    does?
  • p

    pajatopmr

    06/10/2024, 9:27 PM
    I have not used Kover on Compose Desktop (CD) code yet. My best guess is that CD is not handled well by Kover or any other coverage tool. Any experiences that refute my guess? If my guess is a good one, that leaves me to rely on using TDD faithfully, something I find very difficult to do with UI code, hence my reliance on coverage reports as a backstop.
    c
    s
    • 3
    • 3
  • j

    juliocbcotta

    06/17/2024, 12:49 PM
    Hello there folks, I am trying to integrate Kover in my android project and I wrote a very simple gradle plugin to try to integrate it form the root project
    Copy code
    class VeepeeKoverPlugin : Plugin<Project> {
    
        override fun apply(project: Project) {
            with(project) {
                pluginManager.apply("org.jetbrains.kotlinx.kover")
                configureReport()
            }
        }
    
        private fun Project.configureReport() {
            configure<KoverProjectExtension> {
                useJacoco(libs.findVersion("jacoco").get().toString())
                merge.subprojects()
                reports {
                    filters {
                        excludes {
                            androidGeneratedClasses()
                        }
                    }
                }
            }
        }
    }
    However I am getting this error
    Copy code
    * What went wrong:
    A problem was found with the configuration of task ':res:res-privalia:koverXmlReportDebug' (type 'KoverXmlTask').
      - Gradle detected a problem with the following location: '/Users/julio.buenocotta/git/android-vente-privee/res/res-recycle/build/kover/bin-reports/testDebugUnitTest.exec'.
        
        Reason: Task ':res:res-privalia:koverXmlReportDebug' uses this output of task ':res:res-recycle:testDebugUnitTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
        
        Possible solutions:
          1. Declare task ':res:res-recycle:testDebugUnitTest' as an input of ':res:res-privalia:koverXmlReportDebug'.
          2. Declare an explicit dependency on ':res:res-recycle:testDebugUnitTest' from ':res:res-privalia:koverXmlReportDebug' using Task#dependsOn.
          3. Declare an explicit dependency on ':res:res-recycle:testDebugUnitTest' from ':res:res-privalia:koverXmlReportDebug' using Task#mustRunAfter.
    Some modules (like the app module) in the project have flavors, Veepee and Privalia and my apps build.gradle.kts looks like this
    Copy code
    veepeeImplementation(project(":res:res-veepee"))
        privaliaImplementation(project(":res:res-privalia"))
         // For all flavors
        implementation(project(":res:res-recycle"))
    I don't understand why I get this error the module
    res-privalia
    has no dependency on
    res-recycle
    on my side...
    • 1
    • 1
  • j

    juliocbcotta

    06/18/2024, 11:30 AM
    is it possible to create a merged report for modules with flavors and without flavors ? when I run
    ./gradlew koverXmlReportDebug
    it does not include the flavored modules...
  • j

    juliocbcotta

    07/09/2024, 9:27 AM
    Is Kover "*Offline instrumentation*" meant to support Android UI Tests ?
  • a

    Archie

    07/31/2024, 8:51 AM
    Hi, I am trying to exclude androidx Room generated files from kover html reports but is very unsuccessful. I’ve tried doing the follow:
    Copy code
    kover {
        reports {
            filters {
                excludes {
                    classes("my.package.*Dao_Impl") 
                    // or
                    packages("my.package.*Dao_Impl")
                    // or
                    inheritedFrom("my.package.TodoDao")
                }
            }
        }
    }
    But nothing seems to work.. Anyone has tips around this?
  • f

    Fergus Hewson

    10/26/2024, 9:53 PM
    Random question, would anyone be able to help pinpoint what branch I'm missing here? I have 2 tests, one that asserts what is rendered and one to invoke the callback.
    c
    • 2
    • 1
  • f

    Fergus Hewson

    10/28/2024, 11:49 PM
    With kover, I have a test that is hitting requires and I am not sure why they are not fully covered. My test definitely hits both paths here. Is there is a reason why requires don't get full covered?
    e
    k
    • 3
    • 3
  • j

    juliocbcotta

    10/29/2024, 3:11 PM
    has anyone solved the issue of making sonar using the exclusions we set on kover ? Do really need to map the exclusions by hand ? related
  • m

    mudasar187

    01/06/2025, 10:20 AM
    Hi! I have an issue when running kover 0.9.0 with gradle 8.12. I see the output what the problem is, but how to fix it? i'll paste the output in thread.
    • 1
    • 3
  • s

    samuele794

    01/23/2025, 11:45 AM
    Hi, i have an issue with Kover 0.9.0 with exclusion, with this configuration
    Copy code
    kover {
        reports {
            filters {
                excludes {
                    packages("org.koin.ksp.generated", "com.takaotech.dashboard.di")
                }
            }
    
            verify {
                // verification rules for all reports
            }
        }
    }
    with koverHtmlReport packages are excluded corretly, but with koverBinaryReport and import ic file (build/kover/bin-reports/test.ic) on IntelliJ i see packages not excluded.
  • j

    juliocbcotta

    03/11/2025, 10:55 AM
    hey, I tried to update my kover from 0.8.3 to 0.9.1 and I started to get some random issues with
    koverHtmlReport*
    task.... crashing in different modules... I tried to find something in the repository, but couldn't find anything relatively new on the issues tracker, but I noticed that in kover 0.9.0 kover started to access jacoco programmatically... which I think that might have had some side effect.
    Copy code
    Execution failed for task ':features:user-engagement:countrylist:koverHtmlReportVeepee'.
    > A failure occurred while executing kotlinx.kover.gradle.plugin.tools.jacoco.JacocoHtmlReportAction
       > Stream closed
  • e

    Eugen Martynov

    04/11/2025, 10:07 AM
    Question to jacoco experts - we have custom compose preview annotation, but looks like jacoco looks for
    Generated
    substring in the annotation name. Is it possible to overcome?
    m
    • 2
    • 20
  • r

    Rihards

    04/16/2025, 8:50 AM
    Hi! I’m looking for a framework that I could use on Gitlab runner to check the code coverage for a multi-module project. For me the most important is to see the result of all modules combined. Which framework would You recommend?
    c
    • 2
    • 5