Sonar & Gallio: Gallio will not execute, since there are no test projects

I installed Sonar and configured it to analyze our (.NET) projects (using Sonar-Runner). Everything works fine except for tests (MsTest). I googled around, spent quite some time just trying, but no success. Every time I launch a sonar, I see the same line in the output:

Gallio won't execute as there are no test projects 

I even created a new solution with two projects:

  • TestProject => The "main" project has only 1 class
  • TestProject.UnitTests => has some simple unit tests for a class in TestProject

In my sonar.properties file for the solution, I have the following line:

 sonar.dotnet.visualstudio.testProjectPattern=*.UnitTests 

Starting the analysis, everything works fine, and I get the result, except again: "no test projects were found."

In fact, I have tried many things with this property, but none of them have been successful. I also tried with direct access to the dll, with the property:

sonar.dotnet.test.assemblies=D:\\Projects\\TestProject\\TestProject.UnitTests\\bin\\Debug\\TestProject.UnitTests.dll

and some other ways (relative, etc.), but still: no test projects were found.

Does anyone have any experience with this and can help me solve this problem?

PS. When I run Gallio on it, it works, tests run, etc. Also, the correct path to Gallio is in Sonar properties.

+7
source share
1 answer

According to the source code (thanks to grepcode.com) for the Sonar C-sharp plugin, a project qualifies as a test project if its assembly name matches testProjectPattern, by default it is "* .Tests". It can also be set in sonar -project.properties, for example:

 sonar.donet.visualstudio.testProjectPattern=*.UnitTests 

Pay attention to the spelling mistake (donet) ... (!)

+11
source

All Articles