From 17bdba3ee69083e47069e9f26b4ee87d3d5dc3d5 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Thu, 21 Apr 2022 09:23:27 -0400 Subject: Support new perl module namespace in stable branches Commit b3b4d8e68a moved our perl test modules to a better namespace structure, but this has made life hard for people wishing to backpatch improvements in the TAP tests. Here we alleviate much of that difficulty by implementing the new module names on top of the old modules, mostly by using a little perl typeglob aliasing magic, so that we don't have a dual maintenance burden. This should work both for the case where a new test is backpatched and the case where a fix to an existing test that uses the new namespace is backpatched. Reviewed by Michael Paquier Per complaint from Andres Freund Discussion: https://postgr.es/m/20220418141530.nfxtkohefvwnzncl@alap3.anarazel.de Applied to branches 10 through 14 --- src/test/perl/PostgresNode.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/test/perl/PostgresNode.pm') diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 7b2ec29bb74..e3b9b61ff35 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -2272,4 +2272,18 @@ sub corrupt_page_checksum =cut +# support release 15+ perl module namespace + +package PostgreSQL::Test::Cluster; ## no critic (ProhibitMultiplePackages) + +sub new +{ + shift; # remove class param from args + return PostgresNode->get_new_node(@_); +} + +no warnings 'once'; + +*get_free_port = *PostgresNode::get_free_port; + 1; -- cgit v1.2.3