Обсуждение: [HACKERS] Old versions of Test::More
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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Вложения
> 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Вложения
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
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
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
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
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
On 22 Apr. 2017 4:23 am, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
Peter Eisentraut <peter.eisentraut@2ndquadrant.+1. I'm really not at all happy with the prospect that every timecom> 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.
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
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