Question

What is the best way to run your suite of unit tests after each commit?

I'm particularly interested in the case that you do all of your features/changes in branches and keep your trunk stable.

My source control is SVN and I use tortoise SVN as my client.

Is there an SVN event or something along those lines that I can call a .cmd/.bat file?

If the answer is cruisecontrol, how do you check all branches with cruise control?

Was it helpful?

Solution

I would think that you should probably be running your unit tests before the commit. If you are going to test at every commit, you should do it early enough to reject breaking changes.

You can do this with subversion hooks. If you add a pre-commit hook, you can do a build/test before the commit occurs. The hook script will execute on the server.

OTHER TIPS

You need a Continuous Integration Server like CruiseControl. This will monitor svn for changes, fire builds on a commit, follow it up with a test-suite run and flag any errors directly in your system tray (or email or whatever notification you feel comfortable with) You need to setup your CruiseControl by writing a small script (XML mostly) that defines your project needs. Recommended.. you won't go back once you've tasted it. Here's one that I set up back in the day

Update: I don't think there is a global check all branches type of setting. Each branch should be a different trunk url... which means a different project for CruiseControl. If you follow the recommended way of subversion branching (see here), Since CruiseControl itself seems to be using branches in Subversion.. this seems to be the way to go.

I would setup an automated build/deployment process as well. Check out Cruise Control - it can run the unit tests before deploying.

http://cruisecontrol.sourceforge.net/

Use Buildbot.

This has a utility called svn_buildbot.py that can be called from your subversion post-commit script.

Buildbot is subversion away (as well as a number of other VC systems), so can be configured to pull new revisions from branches that you've committed into. It also provides email notifications and a web interface for status checking and forcing builds at a particular revision/branch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top