Sonar test count 0 from Jenkins but looks fine from local machine

Our Jenkins tool as part of mvn package command uploads the data to Sonar tool. When ran the mvn package cmd from local test cases count are uploaded correctly but from Jenkins test cases count are uploaded as 0. We are using Java and maven.

  • Local Java version 17 and maven version 3.9.4
  • Jenkins Java version 17 and maven version 3.9.2
  • Jacoco plugin version 0.8.11
  • Sonar maven plugin version 3.11.0.3922
  • Sonarqube version used is 9.2.4 .
    Can some1 help on this?

Hi,

Welcome to the community!

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

9.2 → 9.9.6 → 10.6 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, analysis won’t count your tests for you. To get that, you need to pass a test execution report in to analysis.

 
HTH,
Ann