JaCoCo Selenium test code coverage and import to Sonar using Ant JaCoCo Selenium test code coverage and import to Sonar using Ant selenium selenium

JaCoCo Selenium test code coverage and import to Sonar using Ant


Sonar 3.3 has a new feature for combine code coverage metrics generated by both unit tests and integration tests. This is done by using two properties to detail the two different report files generated by the jacoco too:

#Tells Sonar where the unit tests code coverage report issonar.jacoco.reportPath=reports/jacoco/jacoco-ut.exec#Tells Sonar where the integration tests code coverage report issonar.jacoco.itReportPath=reports/jacoco/jacoco-it.exec

The Sonar examples project has an integration test example for ANT:

Unfortunately it doesn't give an example of running the actual tests, instead it just shows how to configure an ANT build to load data.

Finally the Sonar documentation has more details with links to the example projects.