Search code examples
.netjenkinssonarqubeopencover

SonarQube Unit Test Coverage shows no information (only a hyphen)


SonarQube Unit Test Coverage shows no information, everything else seems fine.

Setup

  • Jenkins 2.7.2 master/slave approach (SonarQube process is running on a slave)
  • SonarQube 5.6.1 (fresh install, no other projects running)
  • MS Build Scanner for Jenkins 2.1
  • OpenCover 4.6.519

Small Solutions

Small solutions works fine: Code Analysis, Unit Test Coverage and Unit Test Results show in the dashboard.

Big Solutions

Once I moved to this one big Solution (Contains many Projects):

  • No errors in any log file
  • Jenkins job finishes successfully
  • SonarQube dashboard shows the Code Analysis and the Unit Test results
  • Background tasks are all done, no error in those logs either.
  • I can see the output file from OpenCover being created and being used in the logs
  • Unit Test Coverage shows "-" (hyphen, dash)

There are similar questions to this one, none of the few answers apply in my situation.

I also enabled verbose logs.


Solution

  • It turned out the Server running the Jenkins Slave was running what I guess was an earlier release of Visual Studio 2015 (which installs MSBuild). I updated it to what was available (VS 2015 Update 3) and now I can see the coverage.

    It was either that or the fact that I rebooted the Server after the VS update requested for it.

    The idea came to me after I installed a local SonarQube in my development box and realized that what I was previously doing was working fine there.