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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-14 05:11:37
Message-ID: Ygnkidrkal5ormL1@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2022-02-14 06:29:45 pgsql: Improve correlation names in sanity tests
Previous Message Thomas Munro 2022-02-14 04:14:27 pgsql: Add WL_SOCKET_CLOSED for socket shutdown events.

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2022-02-14 05:13:43 Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Previous Message Dilip Kumar 2022-02-14 05:01:17 Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints