Reputation:
I have a project set up for CI in TeamCity, and it's showing some odd results for code coverage:
Note the duplication of the classes.
Looking at one of these classes, the highlighted code as "not covered" is as follows (it's the only code in the class):
public abstract class BaseRepository<T> : BaseRepository<T, long> where T : class
{
protected BaseRepository(ISessionManager sessionManager)
: base(sessionManager)
{
//nothing in here.
}
}
so here's the problem: this code is covered, but I think because TeamCity is counting it three times and the coverage only once, I'm getting 33% coverage... which is not correct.
Can anyone suggest what might be going on here, and how to fix it?
Upvotes: 2
Views: 378
Reputation: 7681
I had similar problem with duplicate test container dll files loaded from multiple locations.
You need to check the Run tests from
and Do not run tests from
sections from your test runner configuration and figure out why the dlls are loaded multiple times. In my case it was the obj
folders, and my Edit assembly files exclude list
now looks like:
**\obj\**\*.dll
You got it tripled, so you probably need to figure out even more locations to exclude.
Upvotes: 3