Re: Making background psql nicer to use in tap tests

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: Re: Making background psql nicer to use in tap tests
Date: 2023-03-18 22:07:46
Message-ID: de0d0e8d-48a7-2008-bc18-723abcc222ff@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-03-17 Fr 18:58, Andres Freund wrote:
> Hi,
>
> On 2023-03-17 12:25:14 -0400, Andrew Dunstan wrote:
>> On 2023-03-17 Fr 10:08, Daniel Gustafsson wrote:
>>>> If we are going to keep this as a separate package, then we should put some code in the constructor to prevent it being called from elsewhere than the Cluster package. e.g.
>>>>
>>>> # this constructor should only be called from PostgreSQL::Test::Cluster
>>>> my ($package, $file, $line) = caller;
>>>> die "Forbidden caller of constructor: package: $package, file: $file:$line"
>>>> unless $package eq 'PostgreSQL::Test::Cluster';
>>> I don't have strong feelings about where to place this, but Cluster.pm is
>>> already quite long so I see a small upside to keeping it separate to not make
>>> that worse.
>>>
>> Yeah, I can go along with that.
> Cool - I'd prefer a separate file. I do find Cluster.pm somewhat unwieldy at
> this point, and I susect that we'll end up with additional helpers around
> BackgroundPsql.
>

Yeah. BTW, a better test than the one above would be

   $package->isa("PostgreSQL::Test::Cluster")

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Иван Панченко 2023-03-18 22:25:27 Bytea PL/Perl transform
Previous Message Andrew Dunstan 2023-03-18 21:53:38 Re: buildfarm + meson