Re: Postgres perl module namespace
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Noah Misch <noah@leadboat.com>, Andres Freund <andres@anarazel.de>, Erik Rijkers <er@xs4all.nl>, Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Mark Dilger <mark.dilger@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-19T02:43:13Z
Lists: pgsql-hackers
On Mon, Apr 18, 2022 at 01:59:23PM -0400, Andrew Dunstan wrote:
> On 2022-04-18 Mo 13:43, Tom Lane wrote:
>> I doubt that just plopping the new Cluster.pm in alongside the old
>> file could work --- wouldn't the two modules need to share state
>> somehow?
>
> No, I think we could probably just port the whole of src/test/PostreSQL
> back if required, and have it live alongside the old modules. Each TAP
> test is a separate miracle - see comments elsewhere about port
> assignment in parallel TAP tests.
Doesn't that mean doubling the maintenance cost if any of the internal
module routines are changed? If the existing in-core TAP tests use
one module or the other exclusively, how do we make easily sure that
one and the other base modules are not broken? There are also
out-of-tree TAP tests relying on those modules, though having
everything in parallel would work.
>> Another thing that ought to be on the table is back-patching
>> 549ec201d (Replace Test::More plans with done_testing). Those
>> test counts are an even huger pain for back-patching than the
>> renaming, because the count is often different in each branch.
>
> +1 for doing that
The harcoded number of tests has been the most annoying part for me,
to be honest, while the namespace change just requires a few seds and
it is a matter of getting used to it. FWIW, I have a git script that
does the same thing as Noah, but only for files part of the code tree,
as of:
for file in $(git grep -l "$OLDSTR")
do
sed -i "s/$OLDSTR/$NEWSTR/g" "$file"
done
--
Michael
Commits
-
Fix PostgreSQL::Test aliasing for Perl v5.10.1.
- fe25c8533c17 12.12 landed
- ca590a4e958f 10.22 landed
- bf92b73beb50 11.17 landed
- aa1845cdd697 13.8 landed
- 4b0d21b06c6b 14.5 landed
-
For PostgreSQL::Test compatibility, alias entire package symbol tables.
- 38790408b020 10.22 landed
- ec26f44d539a 12.12 landed
- e8f037a2df9b 13.8 landed
- c41edb324294 11.17 landed
- 20911775de4a 14.5 landed
-
Make PostgresNode easily subclassable
- 54dacc746628 10.0 cited