kotlinx-kover icon indicating copy to clipboard operation
kotlinx-kover copied to clipboard

How to create a total coverage file?

Open abdullahq3102 opened this issue 1 year ago • 1 comments

Hi I am on version 1.0 of kover and want to aggregate all the coverage into a single html or txt file and not sure how to do that.

I see that they made this PR to create that implementation a couple years ago, but I am not sure about how it works since the readme has been changed a lot since then since the link in that PR's readme change no longer works. The coverage for my system is currently generated like this.

container('gradle') {
  withSonarQubeEnv('Name-Sonar-Cloud') {
    shWithRetryOnGradleException("gradle: Sonarqube analysis", """
    ./gradlew koverXmlReport
    ./gradlew koverHtmlReport
    ./gradlew koverCollectReports
    ./gradlew sonarqube --stacktrace \
      -Dsonar.log.level=TRACE \
      -Dsonar.verbose=true \
      -DenableJacoco=true \
      -Dsonar.branch.name="main" \
      -Dsonar.projectName="android" \
      -Dsonar.coverage.jacoco.htmlReportPaths="${env.WORKSPACE}/build/reports/kover/all/*.html"
      -Dsonar.coverage.jacoco.xmlReportPaths="${env.WORKSPACE}/build/reports/kover/all/*.xml"
      """)
      uploadCodeCoverageToS3()
  }
}

I have tried moving the koverCollectReports that to the beginning but that fails since it requires the html or xml files to exist initially. I think I should be able to use this command to modify the output? I found it the current readme but the workflow is completely different from mine so I am not sure how to add it

coverage-overall - [integer] The overall coverage of the project

abdullahq3102 avatar Apr 15 '24 14:04 abdullahq3102

Hi, at the moment, there is no version of Kover 1.0 yet.

Could you clarify, have you looked through this documentation?

Without additional information about the project, it is hard to give recommendations, because we need to know the hierarchy of modules in the build, as well as which Kotlin plugin is used in each of them (JVM, multiplatform, Android)

shanshin avatar Apr 15 '24 14:04 shanshin

Closed as answered. Feel free to create new issue if you have any additional questions.

shanshin avatar Jun 24 '24 17:06 shanshin