pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
Date: Fri, 3 Jan 2020 20:46:07 +0900
Message-ID: <20200103114607.GA14380@paquier.xyz> (raw)
In-Reply-To: <E1in6ft-0004zR-6l@gemulon.postgresql.org>
References: <E1in6ft-0004zR-6l@gemulon.postgresql.org>

On Thu, Jan 02, 2020 at 08:02:29PM +0000, Tom Lane wrote:
> Add basic TAP tests for psql's tab-completion logic.
> 
> Up to now, psql's tab-complete.c has had exactly no regression test
> coverage.  This patch is an experimental attempt to add some.
> 
> This needs Perl's IO::Pty module, which isn't installed everywhere,
> so the test script just skips all tests if that's not present.
> There may be other portability gotchas too, so I await buildfarm
> results with interest.

Reading through the commit logs, I am not a fan of this part:
+if ($ENV{with_readline} ne 'yes')
+{
+   plan skip_all => 'readline is not supported by this build';
+}
+
+# If we don't have IO::Pty, forget it, because IPC::Run depends on that
+# to support pty connections
+eval { require IO::Pty; };
+if ($@)
+{
+   plan skip_all => 'IO::Pty is needed to run this test';
+}

This has the disadvantage to have people never actually notice if the
tests are running or not because this does not generate a dependency
error.  Skipping things if libreadline is not around is perfectly fine
IMO, but I think that we should harden things for IO::Pty by removing
this skipping part, and by adding a test in configure.in's
AX_PROG_PERL_MODULES.  That would be also more consistent with the
approach we take with other tests.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../20200103114607.GA14380@paquier.xyz/2-signature.asc)
  download

view thread (64+ messages)  latest in thread

Message-ID: <20200103114607.GA14380@paquier.xyz>
Permalink:  ../20200103114607.GA14380@paquier.xyz/
Also on:    postgresql.org/message-id/20200103114607.GA14380@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
  In-Reply-To: <20200103114607.GA14380@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox