Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Missing test coverage dots across projects when referencing build output
ArneG
#1 Posted : Monday, August 1, 2016 8:37:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/26/2014(UTC)
Posts: 3
Location: Denmark

I am having a problem where code coverage is not reported across projects.


Setup:

Projects in Solution:

A (project for which test coverage is desired)
A.Test (has project reference to A, and executes methods from A)
[...other projects...]

The DLL's produced from the projects are located in the output directory bin/

For various reasons (IoC and configuration stuff), for the code to execute, I must include the bin/ output directory in the Additional files to include for project A.Test


Observations:

When the tests in A.Test have executed, coverage in A.Test is indicated with green dots, but code lines in A clearly executed by the tests have black dots.

In the NCrunch Tests window, a warning is shown for the A.Test project, stating that

"NCrunch detected unusual behaviour around the resolution of referenced assemblies required by this project in its test environment.
[...]
The following references raised this warning:
[...]
[...]\167852\23\bin\A.DLL was expected to be loaded from
[...]\167852\7\bin\A.dll
"

Questions:

1 Are the missing code coverage indicators related to the unexpected DLL load location?

2 Are there any suggestions for solving this problem?
Remco
#2 Posted : Monday, August 1, 2016 8:53:41 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

Thanks for sharing this issue.

The problem you're experiencing is caused directly by including the bin\output dir in your additional files to include. By doing this, you are effectively including referenced assemblies from the foreground solution, which will not only suppress any capture of coverage data, but it will also tie your NCrunch background builds to the DLLs in your foreground solution.

Removing the above setting will solve this problem. To correct any issues with your IoC, I recommend enabling the 'Copy referenced assemblies to workspace' setting for both of these projects. This will emulate the assembly co-location structure in your foreground solution and should allow your IoC system to resolve types in the same manner as your application would at runtime.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download