Code coverage problem

Hello sonarsource community,

I’m here to discuss about a strange behaviour on sonarQube. I have some code which is 100% covered by tests on Visual studio.

When I commit my code I can see that all the tests are done and ok. And then on sonarQube I can see a very poor coverage on my commited files. For example the same file that had 100% on VS now has 0% :

Only very few of my tests are taken into account on SonarQube. According to Visual studio I should be at 80%, but passing thru the qualityGate its more like 10 - 15%. As as far as I can see, all the tests Ive done on VS are passed during the code analysis step.

I’m pretty new to SonarQube and I think I’m missing some understanding on the versionning/snapshot side. Does anyone have any clues to help me ?

Thanks in advance and have a good day

hi @Arnaud , welcome to the community!

could please let me know:

  • which version of the scanner for MSBuild are you using?
  • are you producing the coverage reports in the same place? do you have a single project, multiple projects, multiple solutions ?
  • what are the commands that you are running? Are you analyzing a single solution?
  • could you please share the output of the Begin and End step?