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

Notification

Icon
Error

Nancy test doesn't discover modules
moswald
#1 Posted : Friday, July 14, 2017 1:25:19 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/31/2012(UTC)
Posts: 16
Location: Austin, TX

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Reposting my SO question here.

Short summary: when VS Test Explorer runs my tests, Nancy discovers the modules assembly and loads them without any prompting from me. When NCrunch runs those tests, I have to be explicit about which module I'm testing.

https://stackoverflow.co...ng-modules-with-ncrunch
Remco
#2 Posted : Saturday, July 15, 2017 1:21:58 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,967

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi, thanks for sharing this question.

It's been a few years since I last tangled with the Nancy codebase, so my present knowledge on how it resolves assembly references is very uncertain and probably very out of date. Given the way this is structured, my first assumption would be that Nancy has some kind of discovery logic that searches for modules and implicitly includes them based on their location or directory structure. I would have thought that turning on the 'Copy referenced assemblies to workspace' setting would handle such as thing, but it's possible the code is looking back upwards further into the workspace, maybe even parsing the project file or trying to enumerate the solution itself. If so, it's likely not possible to handle it using NCrunch configuration and you may need to find a way to code around the problem.

Something that is worth trying is to see whether just including the relevant assemblies in the test application domain is enough for Nancy to find them. Turning on the preload assembly references configuration setting might do the trick.

Sorry, I wish I could provide more specific advise, but since the logic used to find these modules is in Nancy rather than NCrunch, this is probably more of a Nancy question than an NCrunch one. Someone more familiar with the internals of the Nancy infrastructure may be able to provide more help.
moswald
#3 Posted : Saturday, July 15, 2017 12:38:06 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/31/2012(UTC)
Posts: 16
Location: Austin, TX

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Thanks for the note. I'm also very surprised that copying the referenced assemblies into the workspace didn't fix the issue. Also turning on preloading assembly references didn't help.

I'll check with the Nancy team and if there's a solution I'll come back here with an update.
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.028 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download