We're speaking at
CFUnited 2008:
CFUnited - The Premiere ColdFusion Technical Conference

Search

Calendar

SunMonTueWedThuFriSat
    123
45678910
11121314151617
18192021222324
25262728293031

Subscribe Enter your email address to subscribe to this blog. You'll receive an email when we write a new post.

Recent Entries No recent entries.

Recent Comments Enabling desktop wallpaper on remote desktop terminal services
Dan said: Fantastic, works perfectly.. thank you :) [more]

Flex: Making Scrollbars Follow Focus
radley said: it's close. but unfortunately it doesn't allow me to scroll back to the top. I can move the scrollba... [more]

Revised - Load Testing - Frameworks - The JVM-JRE
Ansar Thennaden said: hi, Thanks for the valuable information. Performance is one of the parameter we used to gauge the be... [more]

Enabling desktop wallpaper on remote desktop terminal services
Richard (produKtNZ) said: Hi =(. After an extensive google search, i found your post. I followed the directions exactly. I ar... [more]

Troubleshooting javax.net.ssl.SSLHandshakeException
Marion Andrin said: Thank you! Awesomely clear. [more]

Archives By Subject Business of Software (5) [RSS]
ColdFusion (326) [RSS]
Conferences (7) [RSS]
Databases (88) [RSS]
Flex & Flash (109) [RSS]
Fusebox (87) [RSS]
General Development (33) [RSS]
Google (9) [RSS]
Hardware (5) [RSS]
JVM & Java (132) [RSS]
Linux (20) [RSS]
Macintosh (1) [RSS]
Miscellaneous (254) [RSS]
Performance (8) [RSS]
SeeFusion (36) [RSS]
Shan's Simple Examples (7) [RSS]
User Interface (3) [RSS]
Windows (5) [RSS]

Archives By Poster Daryl Banttari (11)
Nat Papovich (33)
Patrick Quinn (36)
Shannon Hicks (22)
Steve Nelson (25)
Tyson Vanek (3)


bottom corner

Subversion hook to verify unit testing?

Ever since last year, we've setup subversion to require comments are added before a file can be committed to our SVN repositories. Even just small comments on file commits is helpful.

But what I REALLY want is a subversion hook that requires a file is unit tested before it can be submitted to the repository. Think of the power of that. In fact let me say that again...

Before you can commit a file, you HAVE TO TEST IT LOCALLY.

That's one of the things I've been working on with my inline CFML debugger. So far it's pretty simple, I've added an attribute to the cffunction tags in my unit tests called TestApproved which can either be 1 or 0. So when you run a unit test the inline debug gives you a form to approve the test. If the test itself doesn't throw an error you have decide if the results of the code are correct. Then you just approve.

I just got that working yesterday, this week I'll play with the SVN pre-commit hook. I think that's what I want. Basically I'm just going to have the pre-commit hook search for those TestApproved attributes. I'm going to make it fudgeable on purpose.

Has anyone out there ever done a pre-commit hook with subversion?

Comments
Hey, no specific help to you on this, but we are in a similar spot with a different kind of post commit hook. We have had some success, but its still not right so I feel your pain.

Any Subversion pros out there that can do a little freelance work on the side??
# Posted By Eric Hoffman | 10/22/08 12:35 PM
Yeah I've got a pretty sweet post-commit hook working where it automatically does an svn update on a staging server. So when someone commits to the repository it automatically shows up on the central server for others to look at.

I've been researching this pre-commit hook concept. I think I have a pretty good understanding of it. I'm considering using cURL to call a .cfm page so I can do the heavy lifting with CF instead of batch file bullshit.
# Posted By Steve Nelson | 10/23/08 1:37 PM
Thats the post commit hook I am trying to write. Any chance of letting me see how you got yours to work?

Pretty ingenious running a cURL call. Hmm.

We just moved to Collabnet Sourceforge Enterprise 5, which bundles subversion...its on a wmware image on a windows box. Adds a little layer of intracacy for me. At some point they will migrate it to a full linux box and run it natively. With no linux admins in house though, thats why we went VMWare image until we get one on contract.

Anyhow, these hooks are pretty powerful, so was very interested in seeing how others use it...and your idea for validation purposes is sweet.
# Posted By Eric Hoffman | 10/23/08 1:57 PM
Dan Switzer did a great blog post on a post-commit hook. Take a look:

http://blog.pengoworks.com/index.cfm/2008/2/5/SVN-...
# Posted By Steve Nelson | 10/25/08 1:00 AM
While Subversion hooks are pretty powerful, Subversion really needs a *policy* system. I tried to write a post-commit hook that automatically applies svn:needs-lock to binary files (determined by a regex against file extension), and I ended up having to check out the revision, apply the property locally, then check it back in - all INSIDE the post-commit hook. There's some dicey synchronization going on there, I can tell you that!

Of course, the official position is "educate your users" to apply locks, and use a pre-commit hook to verify that they've done so. Um, you want me to explain the concept and the UI of commit locks to my sales guys and project managers? And force them to do something that could be automated? (The only practical alternative is to pass around a bunch of pre-commit hooks for *Tortoise*, but what happens when one of them is working remotely?)

A proper policy-based system would clear up a lot of the problems people have with pre- and post-commit hooks.
# Posted By Oluseyi | 11/4/08 3:16 PM

bottom corner