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

Notification

Icon
Error

Cannot build and run tests in a complicated server/client project
configurator
#1 Posted : Monday, April 16, 2012 2:47:08 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/16/2012(UTC)
Posts: 2

I just tried to use NCrunch on an existing project (http://github.com/configurator/ravendb). When building with NCrunch set to dynamic analysis, I get errors like "The type or namespace name 'Abstractions' does not exist in the namespace 'Raven' (are you missing an assembly reference?)".

When playing with settings at some point I got it to build, by including ".\**.*" in the additional files to include setting, and setting NCrunch to static analysis. However, all the tests now give me the same error when run: "This test was not executed during a planned execution run. Ensure your test project is stable and does not contain issues in initialisation/teardown fixtures." Now it takes quite a long time to compile though, probably because it's copying the entire solution folder for each project.

Another thing I'd like to mention is that the project is for both a client and a server, and the tests are all run thru the client, which calls the server via HTTP. I'm not sure if NCrunch can detect those kind of dependencies, even if it does manage to run tests - is there something that can be done for this?

I've been working on this for a few hours, trying every setting combination I could think of, but to no avail. Is there anything I should try, or any advice for how to find what's wrong?

Thanks for the help.
Remco
#2 Posted : Monday, April 16, 2012 9:20:43 PM(UTC)
Rank: NCrunch Developer

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

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

Getting NCrunch to run against a large and well established established project that wasn't built with NCrunch in mind can sometimes be challenging. Even more so if you haven't been involved from the project since its first inception.

The best thing I can recommend is to make sure you read through the documentation thoroughly (especially the troubleshooting guides at https://www.ncrunch.net/...ng_project-build-issues and https://www.ncrunch.net/...-runtime-related-issues). This will help you to gain and understand of how NCrunch works and which aspects of your project may experience difficulty.

Large integration tests (https://www.ncrunch.net/documentation/guides_integration-testing) that work cross-process can't be efficiently tracked by NCrunch, as the code coverage is occurring outside NCrunch's task runner executables. Generally the practice I would suggest is to try to use cross process tests only to confirm that the wiring between your processes is working correctly, and try to rely on unit tests to test the actual logic inside the same process - this way you'll have inline code coverage. However, with that said, it is always still possible to have the tests running with NCrunch as you would with any other test runner.

Generally speaking, the problems most often experienced with cross-process integration tests are around their initialisation. Cross process tests have a tendency to make use of implicit dependencies to other files in your solution, or they make assumptions about the known location of other binaries. Both of these situations can require additional configuration in NCrunch, as NCrunch needs to be aware of implicit dependencies (via the 'Additional Files To Include' configuration option), and it will also avoid copying referenced dependencies into build output directories unless the 'Copy referenced assemblies to workspace' configuration option is set. I would definitely recommend you try turning this option on for ALL the projects in your solution, as it will allow you to immediately rule out any issues that might be created by this behaviour (you can always do some work later to allow you to switch it off, thus improving performance).

Also make sure you check carefully the logic inside any initialisation and teardown fixtures, as exceptions thrown here can cause NCrunch to throw blanket errors like the one you've described.

I hope this helps!

Cheers,

Remco
configurator
#5 Posted : Monday, April 23, 2012 2:05:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/16/2012(UTC)
Posts: 2

Hi Remco,
Unfortunately other than the build taking ages, changing these settings didn't help. I guess I'll just have to skip using NCrunch for this project...

Thanks for the help anyway,
configurator.
qujck
#6 Posted : Friday, November 9, 2018 9:02:25 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/19/2014(UTC)
Posts: 17
Location: United Kingdom

Thanks: 9 times
Was thanked: 2 time(s) in 2 post(s)
The links in answer above are dead
Remco
#7 Posted : Friday, November 9, 2018 9:10:25 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
In all fairness, it's been 6 years since those links were posted.

Here is the updated documentation: Troubleshooting build issues
Troubleshooting test issues.
1 user thanked Remco for this useful post.
qujck on 11/9/2018(UTC)
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.050 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download