TFS with SonarQube, no product projects, only test projects

536 views Asked by At

I have installed SonarQube on my local development machine by following installation guide:

SonarQube Installation Guide for Existing TFS Environment.pdf.

The build is succesfull. The project is added to the dashboard. But there was only testcoverage data.

I have 4 projects in my solution, 2 of them are unittest projects. The build for SonarQube logs that there are found 4 test projects and no product projects:

SonarQube Analysis Summary
Analysis succeeded for SonarQube project "ConsoleApplication", version 1.0 (Analysis results)
  Product projects: 0, test projects: 4
  Invalid projects: 0, skipped projects: 0, excluded projects: 0

As far as I can see and have checked I have followed the manual on every point. Is there any setting that I have missed and results in zero product projects?

1

There are 1 answers

3
jessehouwing On BEST ANSWER

Turns out that the MsBuild runner looks at the full path of your project to see if it's a Test project. so if your Build agent name or Build definition name or any folder leading up to your project file has the word "test" in it, all projects will be considered a test.

As discussed offline, in your case it was the Build Definition name. Renaming it to not be named "SonarQubeTestBuild" solved the issue.