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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
Date: 2020-01-03 11:46:07
Message-ID: 20200103114607.GA14380@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-01-03 13:52:57 Re: pgsql: Add basic TAP tests for psql's tab-completion logic.
Previous Message Christoph Berg 2020-01-03 11:01:29 Re: pgsql: Add basic TAP tests for psql's tab-completion logic.

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-01-03 12:01:03 sidewinder has one failure
Previous Message Christoph Berg 2020-01-03 11:01:29 Re: pgsql: Add basic TAP tests for psql's tab-completion logic.