Question

In my company we develope eclipse plugins continuously built by a Jenkins CI Server (with tycho & maven) which also executes the tests (Unit Tests and SWTBot Tests). As a post build action we send the test data (JaCoCo & Surefire reports) via maven to a SonarQube server for analysis. Our sources and tests are each located in an own module.

  • In src/com.mycompany.projectA/ we have the source from Project A.
  • In test/com.mycompany.projectA.tests.ut/ we have the unit tests from Project A.
  • In test/com.mycompany.projectA.tests.swtbot/ we have the swtbot tests from Project A.

In order to allow Sonar to find the Jacoco and Surefire reports for the tests of each source plugin we set the report paths in our pom.xml:

<sonar.jacoco.reportPath>${project.basedir}/../../test/${project.artifactId}.tests.ut/target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.surefire.reportsPath>${project.basedir}/../../test/${project.artifactId}.tests.ut/target/surefire-reports</sonar.surefire.reportsPath>

But this only allows one test per plugin. To also see the SwtBot test coverage in SonarQube, we added the SWTBot tests as integration tests (yeah I know, not very neat...)

<sonar.jacoco.itReportPath>${project.basedir}/../../test/${project.artifactId}.tests.swtbot/target/jacoco.exec</sonar.jacoco.itReportPath>

Like this, we can at least see the unit test coverage as well as the SWTBot test coverage in SonarQube. But as we are only able to set one report path for the surefire reports, those are ignored by Sonar and we can not see how many SWTBot test passed/failed.

Is there a convenient way to add multiple locations of surefire reports to be considered in the analysis?

Was it helpful?

Solution

This is not possible yet, but there's a ticket open for that: https://jira.codehaus.org/browse/SONAR-4101

Feel free to watch it and vote for it.

OTHER TIPS

Maybe you can append the jacoco.exec of each project together and put the integrated jacoco report to Sonar. The following link is a good example to integrate the jacoco report. http://www.lordofthejars.com/2012/07/jacoco-in-maven-multi-module-projects.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top