Tuesday, 11 June 2013

Trying out NCrunch

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:

image

So (with TeamMentor solution opened), I clicked on Enable NCrunch, and the Configuration Wizard appeared:

image

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

image

In Engine Optimisation I chose the option to ‘Optimize for fastest test execution’ (default was the other one)

image

Clicked next on this one:

image

… 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'

image

In Engine Execution Mode I chose the ‘Run my tests automatically when changes are detected’

image

On Ignored tests, I chose the 2nd option to Let my tests run (default was the first)

image

After the final Next, this small NCrunch GUI showed up

image

(ignoring the CPU Warning, which is actually something I need to on this VM), at the moment there is a build failure:

image

Which if we look at Kofi’s NCrunch and TeamMentor post, the solution is to go to the Configuration option:

image

And add these additional files:

UPDATE: I ended up just adding the PostSharp dir (in my efforts to improve the performance of NCrunch)

image

After that change the NCrunch window changed the status of the TeamMentor.CoreLib project:

image

After about 1 minute, we now have a similar error on the TeamMentor.UnitTests project

image

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)

image

Now the Tests are being executed, and after a bit I got 16 tests that failed:

image

With a pretty cool mapping of the tests/lines that passed and failed:

image

Even better is the fact that the actual code (not the unit tests) also show the line coverage!

image

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

image
to 270Mb

image


HUMM....... problems....

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
Post a Comment