pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Christoph Berg <myon@debian.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Add TAP test to automate the equivalent of check_guc
Date: Mon, 14 Feb 2022 14:11:37 +0900
Message-ID: <Ygnkidrkal5ormL1@paquier.xyz> (raw)
In-Reply-To: <20220212201046.uyc2yootpaguph3o@alap3.anarazel.de>
References: <E1nHbaO-0000MF-RO@gemulon.postgresql.org>
	<YgYw25OXV5men8Fj@msg.df7cb.de>
	<2023925.1644591595@sss.pgh.pa.us>
	<20220211153549.GE31460@telsasoft.com>
	<2027230.1644594087@sss.pgh.pa.us>
	<20220211172929.GF31460@telsasoft.com>
	<2079693.1644600871@sss.pgh.pa.us>
	<YgcEK0bJhchPk/NS@paquier.xyz>
	<Ygc3wmaerpCI5l1u@paquier.xyz>
	<20220212201046.uyc2yootpaguph3o@alap3.anarazel.de>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (26+ messages)  latest in thread

Message-ID: <Ygnkidrkal5ormL1@paquier.xyz>
Permalink:  ../Ygnkidrkal5ormL1@paquier.xyz/
Also on:    postgresql.org/message-id/Ygnkidrkal5ormL1@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, andres@anarazel.de, tgl@sss.pgh.pa.us, pryzby@telsasoft.com, myon@debian.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Add TAP test to automate the equivalent of check_guc
  In-Reply-To: <Ygnkidrkal5ormL1@paquier.xyz>
  References: <E1nHbaO-0000MF-RO@gemulon.postgresql.org> <YgYw25OXV5men8Fj@msg.df7cb.de> <2023925.1644591595@sss.pgh.pa.us> <20220211153549.GE31460@telsasoft.com> <2027230.1644594087@sss.pgh.pa.us> <20220211172929.GF31460@telsasoft.com> <2079693.1644600871@sss.pgh.pa.us> <YgcEK0bJhchPk/NS@paquier.xyz> <Ygc3wmaerpCI5l1u@paquier.xyz> <20220212201046.uyc2yootpaguph3o@alap3.anarazel.de> <Ygnkidrkal5ormL1@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox