SonarQube C# Code Coverage include Unit Test Project

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this
    Hi.
    I’m using SonarQube version 6.7.5 (build 38563).
    I’m try to import code coverage from my solution to sonar, but get some issue:
  1. Some project missing from code coverage.
  2. Some project not include from code coverage report file was include on UI.

Here is my code coverage report file: Code Coverage Report File that includes 5 project
Here is my sonar qube code coverage ui: Code Coverage on Sonar Qube that missing some project like: UnitTest project, BatchJob project.
Note that: I not exclusions any file.
Thanks

hey @sonnguyen16694 and welcome to our community

Please answer the following questions

  1. which version of the scanner for MSBuild are you using?

  2. which version of .NET are you targeting?

  3. Are you running the commands in the following order? (see [Coverage & Test Data] Generate Reports for C#, VB.net )

SonarScanner.MSBuild.exe begin /k:“project-key”
MSBuild.exe /t:Rebuild
…RUN CODE COVERAGE COMMANDS HERE …
SonarScanner.MSBuild.exe end

  1. are you running all the commands inside the same folder?

  2. are the coverage reports for the projects you don’t see in SQ being produced correctly? (i.e. does the coverage report file exist on disk)

  3. Please add /d:sonar.verbose=true to the BEGIN step (e.g. SonarScanner.MSBuild.exe begin /k:"MyProject" /d:sonar.verbose=true) and please attach here in a file the output of END step