Re: Postgres perl module namespace - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Postgres perl module namespace
Date
Msg-id Yl4hwZnnSXi6AdRU@paquier.xyz
Whole thread Raw
In response to Re: Postgres perl module namespace  (Andrew Dunstan <andrew@dunslane.net>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman
Next
From: Richard Guo
Date:
Subject: Re: Fix NULL pointer reference in _outPathTarget()