Sonar & Gallio: Gallio won't execute as there are no test projects
Asked Answered
D

1

7

I have installed Sonar and configured it to analyze our (.NET) projects (using Sonar-Runner). Everything works great, except the tests (MsTest). I've googled around, spent quite some time just trying, but no success. Each time I run sonar-runner, I see the same line in the output:

Gallio won't execute as there are no test projects

I've even created a new solution with 2 projects:

  • TestProject => The 'main' project, has only 1 class
  • TestProject.UnitTests => has some simple unit tests on the class in the TestProject

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

sonar.dotnet.visualstudio.testProjectPattern=*.UnitTests

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

Actually I've tried many things with this property, but none have been successful. I also tried with a direct path to the dll, with the property:

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

and some other paths (relative, etc), but still: No test projects found.

Is there anyone who has some experience with this and can help me out with this problem?

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

Daciadacie answered 11/11, 2011 at 13:35 Comment(0)
S
11

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 the testProjectPattern, which defaults to "*.Tests". It can also be set in sonar-project.properties, like this:

sonar.donet.visualstudio.testProjectPattern=*.UnitTests

Note the spelling error (donet)...(!)

Sandi answered 16/11, 2011 at 21:31 Comment(2)
Thanks! Actually, what i did wrong is that I corrected the spelling error! I read that i should set that property, but 'assumed' that it was a typo. I didn't consider it to be a typo in the plugin itself!Daciadacie
FYI the typo in the plugin code has been corrected since. "sonar.dotnet.visualstudio.testProjectPattern" property can be use safely.Dessert

© 2022 - 2024 — McMap. All rights reserved.