TAP test module - PostgresClient

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: TAP test module - PostgresClient
Date: 2017-12-28 08:31:47
Message-ID: 20171228.173147.48313752.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

It would be useful if we have interactive sessions for TAP
tests. My first attempt was apparently unstable one that was
using psql.

https://www.postgresql.org/message-id/20170720.152533.252230418.horiguchi.kyotaro@lab.ntt.co.jp

Finally the test for the patch in the thread made not need such a
machinery but it is still potentially useful.

I found that there's already a implementation of Perl client but
I saw it was GPL. So before I see the code of the client, I made
a small set of Perl client (almost only) for the purpose of TAP
testing. (I don't want replace the existing library with this.)

The patch creates two modules PostgresClient and PgResult in
src/test/perl directory. (patch 1)

Typical usage of it is as follows.

my $server = get_new_node('server');
$server->init();
$server->start;
my $session1 = $server->get_new_session('postgres', 'session1');
my $result = $session1->exec("SELECT c1 FROM ft1 LIMIT 1;");
...

As an usage example, a test for postgres_fdw reconnection
behavior is added as patch 2.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Simple-perl-client-module-for-testing.patch text/x-patch 43.1 KB
0002-Sample-prove_check-of-PostgresClient.patch text/x-patch 3.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2017-12-28 09:04:22 [PATCH] GET DIAGNOSTICS FUNCTION_NAME
Previous Message Yugo Nagata 2017-12-28 08:26:57 Re: [HACKERS] [PATCH] Lockable views