Search code examples
javacode-coveragesonarqubejacoco

Get JaCoCo Integration Coverage from Sonar


I am developing an application using sonar Java web service client API. I would like to get Integration Test code coverage per class from the JaCoCo plugin. Can this be done with this API?


Solution

  • As Mark said, you just have to use the WS API to query the database. What you're missing is probably the name of the metrics related to integration tests (they are not documented yet on our metric definitions page). So here they are:

    • it_coverage
    • it_lines_to_cover
    • it_uncovered_lines
    • it_line_coverage
    • it_coverage_line_hits_data
    • it_conditions_to_cover
    • it_uncovered_conditions
    • it_branch_coverage
    • it_conditions_by_line