Re: pgsql: Add TAP test to automate the equivalent of check_guc

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Christoph Berg <myon(at)debian(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add TAP test to automate the equivalent of check_guc
Date: 2022-02-12 00:49:47
Message-ID: YgcEK0bJhchPk/NS@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Feb 11, 2022 at 12:34:31PM -0500, Tom Lane wrote:
> Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
>> Or, is it okay to use ABS_SRCDIR?
>
> Don't see why not --- other tests certainly do.

Another solution would be to rely on TESTDIR, which is always set as
of the Makefile invocations and vcregress.pl, but that's doomed for
VPATH builds as this points to the build directory, not the source
directory so we would not have access to the sample file. The root
issue here is that we don't have access to top_srcdir when running the
TAP tests, if we want to keep this stuff as a TAP test.

libpq's regress.pl tweaks things by passing down a SRCDIR to take care
of the VPATH problem, but there is nothing in %ENV that points to the
source directory in the context of a TAP test by default, if we cannot
rely on pg_config to find where the sample file is located. That's
different than this thread, but should we make an effort and expand
the data available here for TAP tests?

Hmm. Relying on ABS_SRCDIR in the main test suite would be fine,
though. It also looks that there would be nothing preventing the
addition of the three tests in the TAP test, as of three SQL queries
instead. These had better be written with one or more CTEs, for
readability, at least, with the inner query reading the contents of
the sample file to grab the list of all the GUCs.

I guess that it would be better to revert the TAP test and rework all
that for the time being, then.
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2022-02-12 00:49:57 pgsql: Add VACUUM instrumentation for scanned pages, relfrozenxid.
Previous Message Michael Paquier 2022-02-12 00:46:49 Re: pgsql: Add TAP test to automate the equivalent of check_guc

Browse pgsql-hackers by date

  From Date Subject
Next Message Anders Kaseorg 2022-02-12 00:51:53 Re: PGroonga index-only scan problem with yesterday’s PostgreSQL updates
Previous Message Michael Paquier 2022-02-12 00:46:49 Re: pgsql: Add TAP test to automate the equivalent of check_guc