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

Notification

Icon
Error

Using NCrunch to Run Automated Unit Tests on Server VM
KabanaSoft
#1 Posted : Sunday, April 19, 2015 9:41:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/6/2013(UTC)
Posts: 7
Location: United States of America

Hello,

I have been using nCrunch for over 2 years now and like the unit testing approach for running tests locally on my machine during development.

I am currently looking for a solution for running unit tests automatically on a periodic basis on a VM in my server environment, and wanted to know what the best approach for doing this would be and whether or not i can use nCrunch alone or need to integrate it with other tools. Basically i just want these unit tests to run automatically on a periodic basis on my VM and get alerts of any test that fails.

Here is what i'm looking to do:

1) Run a suite of unit tests on a VM in my server environment on a periodic basis (say every 12 hours).
2) Receive some type of notification (email would be best) on the status of what tests passed and any that did not pass after all tests are run for the given run interval.

Is this possible to do using nCrunch alone or do i need to bring in any other tools to accomplish this task or build a custom solution? If nCrunch cannot accomplish this alone, what is the most common approach to implementing this scenario?

Any help / suggestions / assistance with setting up this automated unit testing scenario in my server environment would be greatly appreciated, thanks!

-Mark
Remco
#2 Posted : Sunday, April 19, 2015 11:18:02 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Mark -

NCrunch itself isn't really designed as a periodic test runner - it's intended to run tests constantly rather than on a timer, which would complicate using it for this scenario. There would be nothing to stop you adding the periodic logic inside a test - though you might need to do some interesting things to allow the results to be reported consistently. For example, you could have a test that checks the current time whenever it is run, and has its own log or data file that it checks this against. If it's been more than 12 hours since the VM logic inside the test was last run, the test will execute it again .. otherwise, it will pull the results of the previous run from the log file and report this instead. NCrunch may run the test 1000 times over the space of a day, but the logic gate inside the test would prevent it executing its logic more than twice over a 24 hour period.

As for the VM, there are a number of ways you could do this. You could set up a VM as a grid node server with NCrunch, and use the RequiredCapabilityAttribute (http://www.ncrunch.net/documentation/reference_runtime-framework_requires-capability-attribute) to specify that the test can only be run on this grid node server.

Alternatively, if you are doing cross-platform testing, you could develop your own infrastructure for launching a clean VM as part of the test run, then setting up some kind of RPC connection into the VM in order to execute the code remotely, reporting the results back to the test runner outside the VM. This would take some invesetment, but it could work very well for some scenarios.
KabanaSoft
#3 Posted : Monday, April 20, 2015 6:22:14 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/6/2013(UTC)
Posts: 7
Location: United States of America

@Remco - Thanks for the response and suggestions, i figured that this was the case.

I think i'm just going to go the route of implementing my own periodic unit testing service and bypass NCrunch, it really shouldn't be too difficult to define the tests to be run and have them run periodically with a little code.

NCrunch is good at what it does and i'll leave it to what its good at :).
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.041 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download