Re: bailing out in tap tests nearly always a bad idea

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: bailing out in tap tests nearly always a bad idea
Дата
Msg-id 20220213234719.fk3ktieef7c4rghv@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: bailing out in tap tests nearly always a bad idea  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: bailing out in tap tests nearly always a bad idea  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Список pgsql-hackers
Hi,

On 2022-02-13 18:32:59 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Best with a
> > central function signalling fatal error, rather than individual uses of die
> > or such.
>
> Huh, doesn't Test::More already provide a sane way to do this?

I looked, and didn't see anything. But I'm not a perl person, so I might just
have missed something.


> If not, why isn't die() good enough?  (I don't think you can
> realistically expect to prohibit die() anywhere in the TAP tests.)

The output of dying isn't great either:

t/000_fail.pl ........................ Dubious, test returned 25 (wstat 6400, 0x1900)
No subtests run

it'd be nicer if that that showed the actual reason for failing, rather than
the unhelpful "Dubious, test returned" stuff. But it's still better than
BAIL_OUT. So I thought that putting the failure handling in a central routine
would allow us to make the exit nicer in a central place / at a later stage...

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: xml_is_well_formed (was Re: buildfarm warnings)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pgsql: Add suport for server-side LZ4 base backup compression.