-1

I originally sent a question about incremental code coverage not working. The coverage was not being calculated and I found out I need to enable the SCM integration for that (i.e. uploading the results straight from Maven locally was not enough).

I managed to make incremental code coverage work with Git. However, not with RTC. I configured my project in SonarQube with my RTC user name and password. The project I'm trying to upload does NOT have a .jazz5/ folder in it, but the top level directory does. That doesn't seem to be a problem, or at least the SonarQube Maven plug-in didn't complain about it.

However, the incremental code coverage is not appearing in SonarQube. I get a dash for the incremental code coverage. Also at no point I had to type in my RTC server information (is it maybe being picked up from ~/.jazz-scm?)

Any inputs on this, or a lead on how I can debug what's going on? The Maven execution completes successfully (mvn sonar:sonar).

Community
  • 1
  • 1
MisterStrickland
  • 947
  • 1
  • 15
  • 35
  • Is there a .jazz5 folder in the dir from which you're running the analysis? – G. Ann - SonarSource Team Sep 01 '16 at 17:38
  • No, the directory right above. – MisterStrickland Sep 01 '16 at 19:38
  • if the .jazz5 folder is necessary and the incremental code coverage won't run without it, why does the Maven plug-in say the build was successful? Shouldn't it return an error message? also, what should be done if I have a directory with dozens of projects (and a `.jazz5` folder) and I want to analyze only a few particular projects that are in subdirectories of that folder? – MisterStrickland Sep 01 '16 at 19:43

2 Answers2

1

Coverage on new code cannot be calculated without SCM data. In fact "new code" cannot be calculated without SCM data.

The Jazz RTC plugin documentation says that auto-detection of your SCM will work

if there is a .jazz5 folder in the project root directory

Here, "project root directory" means the directory from which you run the analysis. From the comments, it seems that your .jazz5 directory exists one level above the analysis directory, and is therefore invisible to the analysis.

In your case, you should either perform the checkout at the lower level (assuming that's possible in Jazz RTC) or perform the analysis from the parent directory and use exclusions to narrow analysis to only what you're interested in.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Hi G. Ann. Unfortunately that was not the case. The plugin documentation page states that you can force the provider using `-Dsonar.scm.provider=jazz` and then won't have any restrictions related to `.jazz5`, which is what I did. Adding `-Dsonar.scm.provider=jazz` to the `mvn` command solved my problem and therefore I didn't have to work with the jazz metadata in the `.jazz5` folder or worry about its location. Maven was able to pick up my user name and password when I added the property. – MisterStrickland Sep 06 '16 at 21:46
0

Adding -Dsonar.scm.provider=jazz to the mvn sonar:sonar command solved the problem for me. Maven was able to pick up my Jazz credentials automatically. I can see the incremental code coverage now.

MisterStrickland
  • 947
  • 1
  • 15
  • 35