Integrating JaCoCo with SONAR for unit and integra

2019-04-08 23:17发布

Has any one tried configuring JaCoCo to dump the coverage of unit and integration tests in 2 different files, for SONAR to use them, using ANT build?

1条回答
该账号已被封号
2楼-- · 2019-04-08 23:55

The following example shows how to integrate jacoco and sonar in an ANT build:

The github samples site gives a Java runner example of how both unit test and integration tests are integrated:

Should be possible to adapt this. The relevant Sonar properties are:

#Tells SonarQube to reuse existing reports for unit tests execution and coverage reports
sonar.dynamicAnalysis=reuseReports

#Tells SonarQube where the unit tests execution reports are
sonar.junit.reportsPath=reports/junit

#Tells SonarQube that the code coverage tool by unit tests is JaCoCo
sonar.java.coveragePlugin=jacoco

#Tells SonarQube where the unit tests code coverage report is
sonar.jacoco.reportPath=reports/jacoco/jacoco-ut.exec

#Tells SonarQube where the integration tests code coverage report is
sonar.jacoco.itReportPath=reports/jacoco/jacoco-it.exec
查看更多
登录 后发表回答