Intrigued by Kofi’s NCrunch and TeamMentor post, and since today I had to write a number of Unit Tests, I decided to give NCrunch a test drive.
I downloaded the MSI, the install was smooth and next time I opened up VisualStudio there was a new NCrunch menu available:
So (with TeamMentor solution opened), I clicked on Enable NCrunch, and the Configuration Wizard appeared:
In the Max Processing Threads, I set the value to 10 (default was 1)
UPDATE: I ended up adding another 3 processor to this VM and making this value 2
In Engine Optimisation I chose the option to ‘Optimize for fastest test execution’ (default was the other one)
Clicked next on this one:
… in Parallel Test Execution, I chose to execute all tests in Parallel (default was No)
UPDATE: I ended up changing this value back to 'NO'
In Engine Execution Mode I chose the ‘Run my tests automatically when changes are detected’
On Ignored tests, I chose the 2nd option to Let my tests run (default was the first)
After the final Next, this small NCrunch GUI showed up
(ignoring the CPU Warning, which is actually something I need to on this VM), at the moment there is a build failure:
Which if we look at Kofi’s NCrunch and TeamMentor post, the solution is to go to the Configuration option:
And add these additional files:
UPDATE: I ended up just adding the PostSharp dir (in my efforts to improve the performance of NCrunch)
After that change the NCrunch window changed the status of the TeamMentor.CoreLib project:
After about 1 minute, we now have a similar error on the TeamMentor.UnitTests project
Which was resolved the same way (adding the extra NuGet packages folder)
UPDATE: I had to also add the TM_Website folder (as in Kofi's example)
Now the Tests are being executed, and after a bit I got 16 tests that failed:
With a pretty cool mapping of the tests/lines that passed and failed:
Even better is the fact that the actual code (not the unit tests) also show the line coverage!
This is awesome!
What a great way to see what is currently being covered by tests and what is failing :)
I really like this….
Let’s see if it holds real development work :)
First I’m going to shutdown ReSharper, which made my VisualStudio instance to go from 505Mbs of memory
Warning: I started using NCrunch with the set-up of only having one core in the VM , and it was just about UNUSABLE :(
The GUI was hanging all the time, and I couldn’t even code a couple lines without being interrupted.
After shutting down the VM and giving it a couple processors, it looks much better.
Let’s see how it holds ...
UPDATE: As you can see by the examples in the Changing the way User Sessions are handled by TeamMentor (will be 3.3 Release HotFix 3) post, I was able to successfully use NCrunch to create a number of UnitTests