Re: Improving log capture of TAP tests with IPC::Run

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improving log capture of TAP tests with IPC::Run
Date: 2015-07-07 21:10:51
Message-ID: 559C405B.3040905@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/25/2015 07:14 AM, Michael Paquier wrote:
> After looking at the issues with the TAP test suite that hamster faced
> a couple of days ago, which is what has been discussed on this thread:
> http://www.postgresql.org/message-id/13002.1434307025@sss.pgh.pa.us
>
> I have developed a patch to improve log capture of the TAP tests by
> being able to collect stderr and stdout output of each command run in
> the tests by using more extensively IPC::Run::run (instead of system()
> that is not able to help much) that has already been sent on the
> thread above.

This is a massive improvement to the usability of TAP tests. They are
practically impossible to debug currently. Thanks for working on this!

The patch redirects the output of all "system_or_bail" commands to a log
file. That's a good start, but I wish we could get *everything* in the
same log file. That includes also:

* stdout and stderr of *all* commands. Including all the commands run
with command_ok/command_fails.

* the command line of commands being executed. It's difficult to follow
the log when you don't know which output corresponds to which command.

* whenever a test case is reported as success/fail.

Looking at the manual page of Test::More, it looks like you could change
where the perl script's STDOUT and STDERR point to, because Test::More
takes a copy of them (when? at program startup I guess..). That would be
much more convenient than decorating every run call with ">> logfile".

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2015-07-07 21:39:25 Re: Improving regression tests to check LOCK TABLE and table permissions
Previous Message Pavel Stehule 2015-07-07 20:24:33 Re: PL/pgSQL, RAISE and error context