Re: More business with $Test::Builder::Level in the TAP tests - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: More business with $Test::Builder::Level in the TAP tests
Date
Msg-id e5b30dbc-4270-4b53-3231-d63072883c77@dunslane.net
Whole thread Raw
In response to More business with $Test::Builder::Level in the TAP tests  (Michael Paquier <michael@paquier.xyz>)
Responses Re: More business with $Test::Builder::Level in the TAP tests  (Daniel Gustafsson <daniel@yesql.se>)
Re: More business with $Test::Builder::Level in the TAP tests  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 10/6/21 2:28 AM, Michael Paquier wrote:
> Hi all,
>
> Following up with Peter E's recent commit 73aa5e0 to add some
> forgotten level incrementations, I got to look again at what I did
> wrong and why this stuff is useful.
>
> I have gone through all the TAP tests and any code paths using
> subroutines, to note that we could improve the locations of the
> reports we get by adding more $Test::Builder::Level.  The context is
> important, as some code paths use rather-long routines and also
> argument values that allow to track easily which test path is being
> taken (like pg_rewind), so there is no need to add anything in such
> places.  The attached patch adds incrementations for the tests where
> the debugging becomes much easier if there is a failure.
>
> Thoughts?



We should probably state a requirement for this somewhere. Maybe in
src/test/perl/README. AIUI, the general rule is that any subroutine that
directly or indirectly calls ok() and friends should increase the level.
Such subroutines that don't increase it should probably contain a
comment stating why, so we can know in future that it's not just an
oversight.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: postgres_fdw: Obsolete comments in GetConnection()
Next
From: Bharath Rupireddy
Date:
Subject: Re: postgres_fdw: Obsolete comments in GetConnection()