ritratt
ritratt

Reputation: 1858

TeamCity reports incorrect code coverage with dotCover for c# unit tests

I am somewhat new to TeamCity. I have set it up for a Visual Studio solution.

I am using NUnit step to run unit tests and dotCover for code coverage. Problem is, there are particular parts of my code that I know are covered by unit tests but in the code coverage report, it shows them with zero coverage.

I know the DLLs are created just fine because I run a dir /s command and can see all the test DLLs.

Many tests are run. But there are some specific tests that are not present in the search report when I search.

Why is this happening and how do I fix it?

Upvotes: 0

Views: 632

Answers (2)

ritratt
ritratt

Reputation: 1858

Stupid me. The DLL that was being ignored was spelled *Test.dll instead of *Tests.dll. I use *Tests.dll in my test path.

The issue got fixed once I changed it to *Test*.dll

Upvotes: 0

Dejan Dakić
Dejan Dakić

Reputation: 2448

Can you please provide information about your NUnit step, especially about .Net Coverage (Filters).

Can you also confirm that tests are actually run?

Full build log (pasted in pastebin.com or such provider) would be also appreciated.

Upvotes: 1

Related Questions