Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcUjU-0004QM-6D for pgsql-committers@arkaria.postgresql.org; Mon, 18 Oct 2021 15:39:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mcUjR-0008OL-GE for pgsql-committers@arkaria.postgresql.org; Mon, 18 Oct 2021 15:39:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcUjR-0008OC-9n for pgsql-committers@lists.postgresql.org; Mon, 18 Oct 2021 15:39:21 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcUjK-00067V-3i for pgsql-committers@lists.postgresql.org; Mon, 18 Oct 2021 15:39:19 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 650381C000D; Mon, 18 Oct 2021 15:39:09 +0000 (UTC) Subject: Re: pgsql: Reference test binary using TESTDIR in 001_libpq_pipeline.pl. To: Alvaro Herrera Cc: Andres Freund , pgsql-committers@lists.postgresql.org References: <202110181423.cmd34pruwlry@alvherre.pgsql> From: Andrew Dunstan Message-ID: Date: Mon, 18 Oct 2021 11:39:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <202110181423.cmd34pruwlry@alvherre.pgsql> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/18/21 10:23 AM, Alvaro Herrera wrote: > On 2021-Oct-17, Andrew Dunstan wrote: > >> +sub find_built_program >> +{ >> + my $program = shift; >> + my $path; >> + >> + if (defined $ENV{MSBUILDDIR}) >> + { >> + # vcregress.pl sets MSBUILDDIR which is the root of all the build dirs >> + my $wanted = sub { $_ eq "$program.exe" && $path = $File::Find::name;}; >> + File::Find::find($wanted,$ENV{MSBUILDDIR}); >> + } > Hmm, it seems weird to have to use File::Find when we already know where > the program is, right? I mean, per your previous patch, we know that > the program is in $MSBUILDDIR/libpq_pipeline/libpq_pipeline.exe, so why > don't we make this one be > > if (defined $ENV{MSBUILDDIR}) > { > return $ENV{MSBUILDDIR} . "$program/$program.exe"; > } Could do, but say the module had two programs? Mostly we don't do that but Release/pg_isolation_regress has two executables, so it's more than just theoretically possible. File::Find on the build directory is likely to be fairly quick, but a simpler way might be to use glob expansion: maybe something like: my @progs = glob("$ENV{MSBUILDDIR}/*/$program.exe"); plus some logic to disambiguate any duplicates. > > ? > > I noticed that drongo is still red, and reporting that no tests are > being run. While this makes sense (because the list of tests is > obtained by running libpq_pipeline), I am surprised that this isn't > reported as such. I would have expected it to die with an error message > starting with "oops: " ... did run_command() fail to return stderr? > > ... oh, run_command() seems a bit too optimistic: it doesn't check > whether IPC::Run::run() failed. I think that's worth fixing > independently. > Yeah. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com