Re: Making background psql nicer to use in tap tests
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Andres Freund <andres@anarazel.de>
Cc: Daniel Gustafsson <daniel@yesql.se>, Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Melanie Plageman <melanieplageman@gmail.com>
Date: 2023-03-18T22:07:46Z
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
Commits
-
Fix missing installation/uninstallation rules for BackgroundPsql.pm
- 241ef53b6a95 12.20 landed
- 0d80e59a1b2c 13.16 landed
- 1185be355462 14.13 landed
- 9d7506a2f7cb 15.8 landed
-
Backport BackgroundPsql perl test module
- 4b467a6581af 12.20 landed
- 12f327b210b3 13.16 landed
- 31877cd8ec8c 14.13 landed
- d5fd7865f068 15.8 landed
- 187b8991f70f 16.4 landed
-
Add missing uninstallation rule for BackgroundPsql.pm
- 7039c7cff673 16.0 cited
-
Fix missing installation rules for BackgroundPsql.pm
- a4c17c86176c 16.0 cited
-
Skip \password TAP test on old IPC::Run versions
- 2e57ffe12f6b 16.0 landed
-
Test SCRAM iteration changes with psql \password
- bf5a894c5571 16.0 landed
-
Refactor background psql TAP functions
- 664d757531e1 16.0 landed