Feature Suggestions

Macro support

Started by crmckenzie on 7,431 views

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.
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
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!

Post a reply

Log in to reply.