Sonar Jacoco for Kotlin Setup not generating code coverage

前端 未结 2 1825
醉话见心
醉话见心 2021-02-07 05:47

I\'m trying to do Sonar Setup with Jacoco for Kotlin to generate Code Coverage report but it\'s not showing any code coverage. While checking Sonar Console it showing following

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-07 06:23

    There are few things you need to do to make it work for kotlin.

    • Ensure your sonarqube > 7.5
    • If your sonarqube ver < 7.5, have the admin install sonar-jacoco plugin. Check the plugin compatibility version if sonarqube < 5.5.
    plugins {
        id "jacoco"
        id "org.sonarqube" version "2.7.1"
    }
    

    Follow this url: https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format/12151

    Add properties in your build.gradle for it to search for jacoco results.

    property 'sonar.coverage.jacoco.xmlReportPaths', "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
    

    Follow this url for properties: https://docs.sonarqube.org/7.5/analysis/analysis-parameters/

提交回复
热议问题