subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Hooks That Use Perl Test::Builder Having Problems with STDERR
Date Wed, 05 Jan 2011 21:36:49 GMT
On Wed, Jan 5, 2011 at 11:30 AM, <> wrote:

> I'm working on porting a fairly extensive set of CVS hooks to SVN.

Okay. Stop right there. When ever someone mentions "a fairly extensive set"
of hooks, I start to think maybe most of what they want shouldn't
necessarily be hooks. When hooks are running, the client is sitting there
waiting for the results. I've been at one place where it wasn't unusual for
a commit to take almost a minute for reformatting, testing, etc. Those were
a group of very frustrated developers.

Besides, how can you even run your tests? The hooks execute on the
Subversion server, yet the working directory is on the client There's no
communication between the server and client until the hooks are complete.

> The issue that I'm having now is that my pre-commit hook, which runs a
Perl script
> that performs tests based on Test::Builder and Test::More, never show
their stderr
> on the console.  I see it in the svn web server logs, but not on the

The problem is that Subversion swallow STDOUT and STDERR from the hooks, and
Subversion won't display STDERR unless the hook script returns a non-zero
exit value, and only then, it displays it on the developer's console. That
may be your problem.

Do you have  continuous build server like Hudson (
Even if you don't need to compile code, you can use something like Hudson
for running your tests. Hudson can checkout the project from the Subversion
repository, run tests, and then report back the results.

Moving your testing to Hudson will simplify your life and help keep a
running record of your test results. Hudson won't interfere with
Test::Builder and Test::More, and you'll be able to keep the test results of
all of your check ins in one easy to find place.

David Weintraub

View raw message