Old versions of Test::More

Started by Andrew Dunstanover 9 years ago9 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t36555
psql -h localhost -U postgres

Built from patchset v2 (message #2), July 28, 2026 at 07:03 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t36555_2 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t36555_2 && git checkout t36555_2

Patchset v2 (message #2) is on t36555_2

Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

As we discovered yesterday via jacana, very old versions of Test::More
don't support the note() function. It therefore seems prudent to specify
a minimum version number for the module in those scripts that use the
function. According to the changelog, version 0.82 (released in Oct
2008) should be sufficient. So I suggest the attached patch.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

test-more-version.patchtext/x-diff; name=test-more-version.patchDownload+3-3
#2Daniel Gustafsson
daniel@yesql.se
In reply to: Andrew Dunstan (#1)
Re: Old versions of Test::More

On 21 Apr 2017, at 15:08, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote:

As we discovered yesterday via jacana, very old versions of Test::More
don't support the note() function. It therefore seems prudent to specify
a minimum version number for the module in those scripts that use the
function. According to the changelog, version 0.82 (released in Oct
2008) should be sufficient. So I suggest the attached patch.

+1 for specifying version (0.82 was replaced with 0.84 within hours but it
doesn’t really matter for this). However, since src/test/ssl/ServerSetup.pm
also invoke note() doesn’t it make sense to add the version requirement there
as well as a guard in case a testscript using ServerSetup isn’t explicitly
specifying the Test::More version?

cheers ./daniel

Attachments:

t36555_2
test-more-version-v2.diffapplication/octet-stream; name=test-more-version-v2.diffDownload+4-4
#3Andrew Dunstan
andrew@dunslane.net
In reply to: Daniel Gustafsson (#2)
Re: Old versions of Test::More

On 04/21/2017 10:36 AM, Daniel Gustafsson wrote:

On 21 Apr 2017, at 15:08, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote:

As we discovered yesterday via jacana, very old versions of Test::More
don't support the note() function. It therefore seems prudent to specify
a minimum version number for the module in those scripts that use the
function. According to the changelog, version 0.82 (released in Oct
2008) should be sufficient. So I suggest the attached patch.

+1 for specifying version (0.82 was replaced with 0.84 within hours but it
doesn’t really matter for this). However, since src/test/ssl/ServerSetup.pm
also invoke note() doesn’t it make sense to add the version requirement there
as well as a guard in case a testscript using ServerSetup isn’t explicitly
specifying the Test::More version?

Yeah, good catch. Will do.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: Old versions of Test::More

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:

As we discovered yesterday via jacana, very old versions of Test::More
don't support the note() function. It therefore seems prudent to specify
a minimum version number for the module in those scripts that use the
function. According to the changelog, version 0.82 (released in Oct
2008) should be sufficient. So I suggest the attached patch.

Maybe it'd be better to put the minimum-version check somewhere central,
like PostgresNode.pm? I suppose that our use of "note" will expand,
and I can't see us remembering to put this into all and only the specific
tests that use "note". Especially if there's no comment about it.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#4)
Re: Old versions of Test::More

On 04/21/2017 10:45 AM, Tom Lane wrote:

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:

As we discovered yesterday via jacana, very old versions of Test::More
don't support the note() function. It therefore seems prudent to specify
a minimum version number for the module in those scripts that use the
function. According to the changelog, version 0.82 (released in Oct
2008) should be sufficient. So I suggest the attached patch.

Maybe it'd be better to put the minimum-version check somewhere central,
like PostgresNode.pm? I suppose that our use of "note" will expand,
and I can't see us remembering to put this into all and only the specific
tests that use "note". Especially if there's no comment about it.

I'll add a comment, but doing it in PostgresNode.pm would mean jacana
(for instance) couldn't run any of the TAP tests. I'mm looking at
installing a sufficiently modern Test::Simple package (includes
Test::More and test::Build) there, but other oldish machines could also
be affected.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#5)
Re: Old versions of Test::More

On 4/21/17 14:49, Andrew Dunstan wrote:

I'll add a comment, but doing it in PostgresNode.pm would mean jacana
(for instance) couldn't run any of the TAP tests. I'mm looking at
installing a sufficiently modern Test::Simple package (includes
Test::More and test::Build) there, but other oldish machines could also
be affected.

Or you could define note() as an empty function if it doesn't exist.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#6)
Re: Old versions of Test::More

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

On 4/21/17 14:49, Andrew Dunstan wrote:

I'll add a comment, but doing it in PostgresNode.pm would mean jacana
(for instance) couldn't run any of the TAP tests. I'mm looking at
installing a sufficiently modern Test::Simple package (includes
Test::More and test::Build) there, but other oldish machines could also
be affected.

Or you could define note() as an empty function if it doesn't exist.

+1. I'm really not at all happy with the prospect that every time
somebody adds a use of "note" to some new TAP test, we're going to
get a complaint later that that test no longer works on jacana.
We need to either decide that non-ancient Test::More is a hard
requirement for all the tests, or fix things with a centralized
solution. A dummy (or not so dummy?) implementation would serve
for the latter.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#8Craig Ringer
craig@2ndquadrant.com
In reply to: Tom Lane (#7)
Re: Old versions of Test::More

On 22 Apr. 2017 4:23 am, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

On 4/21/17 14:49, Andrew Dunstan wrote:

I'll add a comment, but doing it in PostgresNode.pm would mean jacana
(for instance) couldn't run any of the TAP tests. I'mm looking at
installing a sufficiently modern Test::Simple package (includes
Test::More and test::Build) there, but other oldish machines could also
be affected.

Or you could define note() as an empty function if it doesn't exist.

+1. I'm really not at all happy with the prospect that every time
somebody adds a use of "note" to some new TAP test, we're going to
get a complaint later that that test no longer works on jacana.
We need to either decide that non-ancient Test::More is a hard
requirement for all the tests

That seems like a no-brainer TBH. Why are we bothering with backwards
compat with ancient versions of test frameworks? It seems like a colossal
waste of time for no benefit.

or fix things with a centralized
solution. A dummy (or not so dummy?) implementation would serve
for the latter.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Andrew Dunstan
andrew@dunslane.net
In reply to: Craig Ringer (#8)
Re: Old versions of Test::More

On 04/21/2017 09:22 PM, Craig Ringer wrote:

On 22 Apr. 2017 4:23 am, "Tom Lane" <tgl@sss.pgh.pa.us
<mailto:tgl@sss.pgh.pa.us>> wrote:

Peter Eisentraut <peter.eisentraut@2ndquadrant.com
<mailto:peter.eisentraut@2ndquadrant.com>> writes:

On 4/21/17 14:49, Andrew Dunstan wrote:

I'll add a comment, but doing it in PostgresNode.pm would mean

jacana

(for instance) couldn't run any of the TAP tests. I'mm looking at
installing a sufficiently modern Test::Simple package (includes
Test::More and test::Build) there, but other oldish machines

could also

be affected.

Or you could define note() as an empty function if it doesn't exist.

+1. I'm really not at all happy with the prospect that every time
somebody adds a use of "note" to some new TAP test, we're going to
get a complaint later that that test no longer works on jacana.
We need to either decide that non-ancient Test::More is a hard
requirement for all the tests

That seems like a no-brainer TBH. Why are we bothering with backwards
compat with ancient versions of test frameworks? It seems like a
colossal waste of time for no benefit.

OK, I have pushed a requirement for a minimum version of Test::More into
TestLib.pm, a better place for it than PostgresNode.pm as not all tests
use the latter.

jacana has been upgraded to use a sufficiently modern Test::More.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers