You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Kevin Wu <ke...@gmail.com> on 2010/06/12 02:56:57 UTC

How to automatically run some test when check-in

Hi,

I am new to svn.

I want that every time someone checks in his or her code, the sever can
invoke some tests, which might run on another server.

The svn sever only invokes the tests; it doesn't run them.

Is svn capable of doing this?

-- 
Best wishes,
Kevin Wu

Re: How to automatically run some test when check-in

Posted by Kevinm <ke...@gmail.com>.
On Mon, Jun 14, 2010 at 10:28 AM, Csaba Raduly <rc...@gmail.com> wrote:

> On Sat, Jun 12, 2010 at 6:07 AM, Les Mikesell wrote:
> > Kevin Wu wrote:
> >> I want that every time someone checks in his or her code, the sever can
> >> invoke some tests, which might run on another server.
> >
> > You might run some ssh command as a post-commit hook, but you would
> probably
> > be better off using something like hudson (http://hudson-ci.org/) which
> can
> > poll for changes and run jobs with a more complete cross-platform
> framework.
>
> Those using Trac (http://trac.edgewall.org/) might get Bitten
> (http://bitten.edgewall.org/)
> :)
> There's also CruiseControl, although it seems heavily Java-oriented.
>

I you want to test on different platforms, then buildbot could work for you.
It supports both polling and email triggered processes:
http://buildbot.net/
http://djmitche.github.com/buildbot/docs/0.8.0/SVNPoller.html#SVNPoller
http://djmitche.github.com/buildbot/docs/0.8.0/Mail_002dparsing-ChangeSources.html#Mail_002dparsing-ChangeSources

Re: How to automatically run some test when check-in

Posted by Csaba Raduly <rc...@gmail.com>.
On Sat, Jun 12, 2010 at 6:07 AM, Les Mikesell wrote:
> Kevin Wu wrote:
>> I want that every time someone checks in his or her code, the sever can
>> invoke some tests, which might run on another server.
>
> You might run some ssh command as a post-commit hook, but you would probably
> be better off using something like hudson (http://hudson-ci.org/) which can
> poll for changes and run jobs with a more complete cross-platform framework.

Those using Trac (http://trac.edgewall.org/) might get Bitten
(http://bitten.edgewall.org/)
:)
There's also CruiseControl, although it seems heavily Java-oriented.



-- 
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

Re: How to automatically run some test when check-in

Posted by Les Mikesell <le...@gmail.com>.
Ryan Schmidt wrote:
> On Jun 12, 2010, at 04:55, Kevin Wu wrote:
> 
>> I want to try svn hooks first.
>>
>> After reading the documentation, I still don't know how to get the filename and its path of the file being committed when the post-commit hook fires.
>>
>> The post-commit hook just has two arguments:
>>
>> 1. Repository path
>> 2. Revision number created by the commit
> 
> You feed the repository path and revision number to "svnlook changed".
> 

Note that many files can change in one commit.  You probably want your ssh 
command to do an update of a working copy where the tests are performed which 
will pick up all the changes.  Also note that additional commits may happen 
before earlier runs are complete - I'm not sure if these block or if your 
scripts have to deal with it.  Scheduling runs and collating the results are 
just a few of the advantages of using hudson.

-- 
   Les Mikesell
    lesmikesell@gmail.com

Re: How to automatically run some test when check-in

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 12, 2010, at 04:55, Kevin Wu wrote:

> I want to try svn hooks first.
> 
> After reading the documentation, I still don't know how to get the filename and its path of the file being committed when the post-commit hook fires.
> 
> The post-commit hook just has two arguments:
> 
> 1. Repository path
> 2. Revision number created by the commit

You feed the repository path and revision number to "svnlook changed".


Re: How to automatically run some test when check-in

Posted by Stephen Connolly <st...@gmail.com>.
On 12 June 2010 10:55, Kevin Wu <ke...@gmail.com> wrote:

> Thanks to those replied.
>
> I want to try svn hooks first.
>
>
You can use the svn hooks to trigger hudson or have hudson poll svn.

For maintenance, I recommend hudson polling svn rather than the svn hook
mechanism.

Just use Hudson you'll be set up in 30min as long as you have a machine with
Java 1.5+ on it to run Hudson (you don't need to be writing java software to
use Hudson)

-Stephen


> After reading the documentation, I still don't know how to get the filename
> and its path of the file being committed when the post-commit hook fires.
>
> The post-commit hook just has two arguments:
>
> 1. Repository path
> 2. Revision number created by the commit
>
>
>
> On Sat, Jun 12, 2010 at 12:07 PM, Les Mikesell <le...@gmail.com>wrote:
>
>> Kevin Wu wrote:
>>
>>> Hi,
>>>
>>> I am new to svn.
>>>
>>> I want that every time someone checks in his or her code, the sever can
>>> invoke some tests, which might run on another server.
>>>
>>> The svn sever only invokes the tests; it doesn't run them.
>>>
>>> Is svn capable of doing this?
>>>
>>
>> You might run some ssh command as a post-commit hook, but you would
>> probably be better off using something like hudson (http://hudson-ci.org/)
>> which can poll for changes and run jobs with a more complete cross-platform
>> framework.
>>
>> --
>>  Les Mikesell
>>   lesmikesell@gmail.com
>>
>
>
>
> --
> Best wishes,
> Kevin Wu
>

Re: How to automatically run some test when check-in

Posted by Kevin Wu <ke...@gmail.com>.
Thanks to those replied.

I want to try svn hooks first.

After reading the documentation, I still don't know how to get the filename
and its path of the file being committed when the post-commit hook fires.

The post-commit hook just has two arguments:

1. Repository path
2. Revision number created by the commit


On Sat, Jun 12, 2010 at 12:07 PM, Les Mikesell <le...@gmail.com>wrote:

> Kevin Wu wrote:
>
>> Hi,
>>
>> I am new to svn.
>>
>> I want that every time someone checks in his or her code, the sever can
>> invoke some tests, which might run on another server.
>>
>> The svn sever only invokes the tests; it doesn't run them.
>>
>> Is svn capable of doing this?
>>
>
> You might run some ssh command as a post-commit hook, but you would
> probably be better off using something like hudson (http://hudson-ci.org/)
> which can poll for changes and run jobs with a more complete cross-platform
> framework.
>
> --
>  Les Mikesell
>   lesmikesell@gmail.com
>



-- 
Best wishes,
Kevin Wu

Re: How to automatically run some test when check-in

Posted by Les Mikesell <le...@gmail.com>.
Kevin Wu wrote:
> Hi,
> 
> I am new to svn.
> 
> I want that every time someone checks in his or her code, the sever can 
> invoke some tests, which might run on another server.
> 
> The svn sever only invokes the tests; it doesn't run them.
> 
> Is svn capable of doing this?

You might run some ssh command as a post-commit hook, but you would probably be 
better off using something like hudson (http://hudson-ci.org/) which can poll 
for changes and run jobs with a more complete cross-platform framework.

-- 
   Les Mikesell
    lesmikesell@gmail.com