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 20220214174620.bt35ruq3qnzddhtu@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: bailing out in tap tests nearly always a bad idea  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Ответы 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  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

On 2022-02-14 16:08:42 +0000, Dagfinn Ilmari Mannsåker wrote:
> die()-ing is the correct way to abort a single test script.

There's really no way to nice way to abort without the "Dubious, test returned
255 (wstat 65280, 0xff00)" stuff?

Even just getting rid of the "Tests were run but no plan was declared and
done_testing() was not seen." noise would be helpful. So I think using a fatal
error routine that forced a failure to be recognized via ok(0, 'fatal error')
and then does done_testing() would be better...


> t/die-immediately.t .... aieee at t/die-immediately.t line 1.
> t/die-immediately.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
> No subtests run

Hm. Looks different when a test is including our test helpers.

t/000_die_pg_test_utils.pl .. Dubious, test returned 25 (wstat 6400, 0x1900)
No subtests run
t/000_die_test_more.pl ...... error at t/000_die_test_more.pl line 2.
t/000_die_test_more.pl ...... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run

So I think we broke something... I think it's the log file redirection stuff
in INIT.

Greetings,

Andres Freund



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Mark all GUC variable as PGDLLIMPORT
Следующее
От: Robert Haas
Дата:
Сообщение: Re: bailing out in tap tests nearly always a bad idea