Re: pgsql: Add basic TAP tests for psql's tab-completion logic. - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
Date
Msg-id 20200103114607.GA14380@paquier.xyz
Whole thread Raw
In response to pgsql: Add basic TAP tests for psql's tab-completion logic.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
List pgsql-committers
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

Attachment

pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: pgbench: Improve test description
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic.