Subversion workflow: forced update, build, pre-commit testing

Is it possible to create an svn commit binding that confirms that the working directory has been updated, embedded, and tested by svn before commit? I want to at least make sure that the code has been compiled and tested with the latest code in the trunk before the developer can execute. This will prevent integration issues in the trunk when developers modify other source code, which leads to a build failure.

An alternative would be to prevent commit if there are files that have been updated (but not necessarily changed in the working directory).

As in the previous question, my work captures the binaries as well as the source. One of the reasons for this is that there is a binary conflict on commit, which, as you know, happened with a change in the source for this binary, so you need to run svn-update and recompile. It also makes merging and renews pain. I understand that if developers were to upgrade to a commit, it would be less likely that this check would be required.

+4
source share
1 answer

SVN itself ensures that the file is updated. You do not need to verify that people are checking the update file.

For the compilation / testing part, you may have client-side hooks using TortoiseSVN that will compile the code and run the tests as part of the pre-commit hook. The caveat is that you cannot be sure that every developer has hook settings.

You can also see something similar to Rake Commit tasks

Following are the steps described above:

  • Queries for commit reporting
  • Adds new files to subversion
  • Removes missing files from subversion
  • Svn update
  • Runs the default rake job (which should run tests)
  • Checks cruisecontrol.rb to see if the build is going through.
  • Checks the code
+1
source

All Articles