4

I run sudo svn --username radek update ".$codebase." --force"; from my php script (on SuSE) every night before automation testing starts. So the testing is done on the latest code that was checked in today.

How can I for sure know that svn up finished successfully? So in case it wasn't the testing is not triggered?

4

3 回答 3

5

svn update should return a non-zero value if there were any failures (e.g. network error/disk error)

However an additional consideration is merge conflicts. svn update considers as "success" updating the working copy with merge conflicts.

Therefore, it may be important for you to also run svn status -q and look for files with "C" status, depending on your application--I'm assuming you want to take a different action if the update completes with conflicts.

于 2012-04-05T04:18:56.837 回答
4

From the command line, I usually run svn status -q which should print nothing if everything is up to date. Otherwise, it will either error out, or display what files haven't been updated yet.

As others have mentioned, svn up should return a non-zero value if it failed for any particular reason.

You should look into using a continuous build system like Jenkins. You could have Jenkins run your tests with every commit, or automatically have it run at a particular time during the day. This way, you're not reinventing the wheel. Plus, Jenkins could email the test results and give you a place to display them.

于 2012-04-05T03:45:44.223 回答
3

use either the return code of the svn command(should be zero), or check the last line of the std-output. It should be something like:

At revision 123.

Keep in mind, that you should have the correct LOCALE

于 2012-04-05T01:23:56.677 回答