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.com/questions/45103949/nancy-tests-not-finding-modules-with-ncrunch
Remco NCrunch Developer
#10771
15 Jul 2017 01:21 UTC
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.
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.
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.
I'll check with the Nancy team and if there's a solution I'll come back here with an update.
Post a reply
Log in to reply.