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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Justin Pryzby <pryzby@telsasoft.com>, Christoph Berg <myon@debian.org>, pgsql-hackers@lists.postgresql.org
Date: 2022-02-14T05:11:37Z
Lists: pgsql-hackers
On Sat, Feb 12, 2022 at 12:10:46PM -0800, Andres Freund wrote:
> Tap tests currently are always executed in the source directory above t/, as
> far as I can tell. So I don't think VPATH/non-VPATH or windows / non-windows
> would break using a relative reference from the test dir.

That would mean to rely on $ENV{PWD} for this job, as of something
like that:
-# Find the location of postgresql.conf.sample, based on the information
-# provided by pg_config.
-my $sample_file =
-  $node->config_data('--sharedir') . '/postgresql.conf.sample';
+my $rootdir = $ENV{PWD} . "/../../../..";
+my $sample_file = "$rootdir/src/backend/utils/misc/postgresql.conf.sample";

A run through the CI shows that this is working, and it also works
with Debian's patch for the config data.  I still tend to prefer the
readability of a TAP test over the main regression test suite for this
facility.  Even if we could use the same trick with PG_ABS_SRCDIR, I'd
rather not add this kind of dependency with a file in the source
tree in src/test/regress/.  Do others have any opinions on the matter?
--
Michael

Commits

  1. Revert "Add TAP test to automate the equivalent of check_guc"

  2. Add TAP test to automate the equivalent of check_guc