pgsql: Improve logging of TAP tests.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve logging of TAP tests.
Date: 2015-07-28 17:19:30
Message-ID: E1ZK8XK-0002FA-6L@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve logging of TAP tests.

Create a log file for each test run. Stdout and stderr of the test script,
as well as any subprocesses run as part of the test, are redirected to
the log file. This makes it a lot easier to debug test failures. Also print
the test output (ok 12 - ... messages) to the log file, and the command
line of any external programs executed with the system_or_bail and run_log
functions. This makes it a lot easier to debug failing tests.

Modify some of the pg_ctl and other command invocations to not use 'silent'
or 'quiet' options, and don't redirect output to /dev/null, so that you get
all the information in the log instead.

In the passing, construct some command lines in a way that works if $tempdir
contains quote-characters. I haven't systematically gone through all of
them or tested that, so I don't know if this is enough to make that work.

pg_rewind tests had a custom mechanism for creating a similar log file. Use
the new generic facility instead.

Michael Paquier and Heikki Linnakangas.

This is a backpatch of Heikki's commit 1ea06203b82b98b5098808667f6ba652181ef5b2.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fa4a4df93c8c28d5684cacb1677fbd13f58bb9f2

Modified Files
--------------
src/Makefile.global.in | 1 +
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 2 +-
src/bin/pg_controldata/t/001_pg_controldata.pl | 2 +-
src/bin/pg_ctl/t/001_start_stop.pl | 2 +-
src/bin/pg_ctl/t/002_status.pl | 4 +-
src/bin/pg_rewind/.gitignore | 1 -
src/bin/pg_rewind/Makefile | 2 +-
src/bin/pg_rewind/RewindTest.pm | 85 ++++++++--------------
src/bin/pg_rewind/t/001_basic.pl | 1 -
src/bin/pg_rewind/t/002_databases.pl | 1 -
src/bin/pg_rewind/t/003_extrafiles.pl | 1 -
src/test/perl/SimpleTee.pm | 27 +++++++
src/test/perl/TestLib.pm | 93 +++++++++++++++++++-----
src/test/ssl/ServerSetup.pm | 6 +-
14 files changed, 143 insertions(+), 85 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-07-28 17:21:28 pgsql: Remove an unsafe Assert, and explain join_clause_is_movable_into
Previous Message Heikki Linnakangas 2015-07-28 08:35:15 pgsql: Fix bug in collecting total_latencies from all threads in pgbenc