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

Notification

Icon
Error

Macro support
crmckenzie
#1 Posted : Thursday, May 24, 2012 8:22:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/27/2012(UTC)
Posts: 3
Location: Seattle, WA

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I'd like to run a local commit every time NCrunch has a successful test run. It strikes me that the easiest way to accomplish this is to run a powershell script before and after a successful (or failed) test run.

This could be done by convention--
ncrunch.beforeTestRun.ps1
ncrunch.afterTestRun.ps1
ncrunch.afterTestRunFailure.ps1
ncrunch.afterTestRunSuccess.ps1

the argument to the powershell function could be an object with metadata about the test run.
Remco
#2 Posted : Thursday, May 24, 2012 10:49:13 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi, thanks for posting!

This is an interesting idea. At the moment NCrunch isn't designed to be able to cleanly handle a feature like this as the definition of a 'test run' can actually be very subjective in the context of true continuous testing, but I do have very long term plans to introduce changes that should in theory make things like this possible.

I am, however, quite interested in your objectives behind using a source control system in this way. Is it with the intention of creating a more reliable undo/redo mechanism, or to share code with teammates?


Cheers,

Remco
crmckenzie
#3 Posted : Thursday, May 24, 2012 11:12:43 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/27/2012(UTC)
Posts: 3
Location: Seattle, WA

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I'm interested in teaching courses on TDD and other patterns and practices. My idea is that I could be demonstrating the techniques, and each time the tests complete successfully I would issue a command to commit to my DCVS. At the end of the course, I could make the DCVS available to the students and they would have a fairly granular record of all the changes that occurred in the code. Optimally this would work in conjunction with another requested feature I saw in the forums in which the test-run would be kicked off on a Save instead of manually or "by the keystroke" as seems to be the case right now.

I can think of other uses as well--collecting data on the percentage of time the local build spends in a green state, for example. Once NCrunch begins executing powershell scripts, I can pretty much do anything I can think of that would be interesting. That information could be useful in measuring the complexity of a given change to the code and the associated test infrastructure. Rather than submit every little thing I can think of to you, if I could just tap into NCrunch "events" via powershell scripts located in my solution and project folders and do anything I wanted.

Combined with NuGet, such an idea could foster an entire ecosystem of NCrunch/Powershell plugins and libraries. Sort of an "enable-the-community-and-they-will-come" approach I guess.

Glad you liked the idea!
1 user thanked crmckenzie for this useful post.
Remco on 5/25/2012(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.057 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download