Search code examples
javaunit-testingmavenautomated-testssonarqube

Sonar how to run unit test successfully


I have a project built with maven and I recently integrated Sonar... It is really easy to configure Sonar to analyze you're project but I couldn't configure it to run my project unit test also. I tried something with Jacoco but I get some Seam error and all the other tests are skipped. By the way I'm using TestNG to run tests manually.


Solution

  • Sonar cannot run tests, it can only analyze testing reports.

    You can run yourself JUnit ( using Maven or Ant for exemple ) and push reports to Sonar (try Sonar's Maven plugin for that)

    or you can give yourself a build factory (try hudson for exemple) and plug it to sonar.