Re: Postgres perl module namespace

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Erik Rijkers <er(at)xs4all(dot)nl>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres perl module namespace
Date: 2022-04-19 02:43:13
Message-ID: Yl4hwZnnSXi6AdRU@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2022-04-19 02:51:49 Re: Fix NULL pointer reference in _outPathTarget()
Previous Message Michael Paquier 2022-04-19 02:33:25 Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman