From: Andrew Dunstan <andrew@dunslane.net>
To: Andres Freund <andres@anarazel.de>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Reference test binary using TESTDIR in 001_libpq_pipeline.pl.
Date: Wed, 20 Oct 2021 17:27:26 -0400
Message-ID: <d6fe7d77-314c-0332-209f-b1294424d37d@dunslane.net> (raw)
In-Reply-To: <20211020190916.bzvnmo6kxeqehczv@alap3.anarazel.de>
References: <202110181423.cmd34pruwlry@alvherre.pgsql>
<ffca3f20-e0ed-5328-7793-cffe9cb7d59f@dunslane.net>
<20211020163123.adogznqee7oosvj5@alap3.anarazel.de>
<1ccbc9a2-1e0f-93bf-745d-99b3409e10ae@dunslane.net>
<20211020190916.bzvnmo6kxeqehczv@alap3.anarazel.de>
On 10/20/21 3:09 PM, Andres Freund wrote:
> Hi,
>
> On 2021-10-20 14:30:49 -0400, Andrew Dunstan wrote:
>> On 10/20/21 12:31 PM, Andres Freund wrote:
>>> ISTM that we should just make the "test invocation framework" responsible to
>>> put the relevant directory onto PATH? I.e. Makefile.global should add the
>>> build directory of the test to PATH, and vcregress.pl should put the relevant
>>> $configuration/$project/ directory there?
>> Like this? That seems reasonable.
> Yea, that's along the lines of what I was thinking...
>
OK, it turns out that it's better to put the addition at the end of the
PATH, otherise initdb complains that it can't find postgres in the same
directory.
This patch has been tested on Linux but not yet on Windows/MSVC,
although I have little doubt it will work there too.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.comAttachments:libpq_pipeline_fix4.patch (text/x-patch, 2.9K) downloaddiff --git a/src/Makefile.global.in b/src/Makefile.global.inindex a1da1ea4ee..5ff5c0c1a1 100644--- a/src/Makefile.global.in+++ b/src/Makefile.global.in@@ -438,7 +438,7 @@ ld_library_path_var = LD_LIBRARY_PATH
# need something more here. If not defined then the expansion does
# nothing.
with_temp_install = \
- PATH="$(abs_top_builddir)/tmp_install$(bindir):$$PATH" \+ PATH="$(abs_top_builddir)/tmp_install$(bindir):$$PATH:$(CURDIR)" \
$(call add_to_path,$(strip $(ld_library_path_var)),$(abs_top_builddir)/tmp_install$(libdir)) \
$(with_temp_install_extra)
@@ -449,8 +449,8 @@ define prove_installcheck
rm -rf '$(CURDIR)'/tmp_check
$(MKDIR_P) '$(CURDIR)'/tmp_check
cd $(srcdir) && \
- TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' \- top_builddir='$(CURDIR)/$(top_builddir)' \+ TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH:$(CURDIR)" \+ PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' \
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
endef
@@ -459,8 +459,8 @@ define prove_installcheck
rm -rf '$(CURDIR)'/tmp_check
$(MKDIR_P) '$(CURDIR)'/tmp_check
cd $(srcdir) && \
- TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' \- top_builddir='$(top_builddir)' \+ TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH:$(CURDIR)" \+ PGPORT='6$(DEF_PGPORT)' top_builddir='$(top_builddir)' \
PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' \
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
endef
diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.plindex 6721edfa71..7f648b19a2 100644--- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl+++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl@@ -14,9 +14,8 @@ $node->init;
$node->start;
my $numrows = 700;
-my $libpq_pipeline = "$ENV{TESTDIR}/libpq_pipeline";-my ($out, $err) = run_command([ $libpq_pipeline, 'tests' ]);+my ($out, $err) = run_command([ 'libpq_pipeline', 'tests' ]);
die "oops: $err" unless $err eq '';
my @tests = split(/\s+/, $out);
@@ -39,8 +38,8 @@ for my $testname (@tests)
# Execute the test
$node->command_ok(
[
- $libpq_pipeline, @extraargs,- $testname, $node->connstr('postgres')+ 'libpq_pipeline', @extraargs,+ $testname, $node->connstr('postgres')
],
"libpq_pipeline $testname");
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.plindex 35e8f67f01..2ed8de4aad 100644--- a/src/tools/msvc/vcregress.pl+++ b/src/tools/msvc/vcregress.pl@@ -248,6 +248,8 @@ sub tap_check
$ENV{REGRESS_SHLIB} = "$topdir/src/test/regress/regress.dll";
$ENV{TESTDIR} = "$dir";
+ my $module = basename $dir;+ $ENV{PATH} = "$ENV{PATH};$topdir/$Config/$module";
rmtree('tmp_check');
system(@args);
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: andrew@dunslane.net, andres@anarazel.de, alvherre@alvh.no-ip.org
Subject: Re: pgsql: Reference test binary using TESTDIR in 001_libpq_pipeline.pl.
In-Reply-To: <d6fe7d77-314c-0332-209f-b1294424d37d@dunslane.net>
References: <202110181423.cmd34pruwlry@alvherre.pgsql> <ffca3f20-e0ed-5328-7793-cffe9cb7d59f@dunslane.net> <20211020163123.adogznqee7oosvj5@alap3.anarazel.de> <1ccbc9a2-1e0f-93bf-745d-99b3409e10ae@dunslane.net> <20211020190916.bzvnmo6kxeqehczv@alap3.anarazel.de> <d6fe7d77-314c-0332-209f-b1294424d37d@dunslane.net>
* 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