Re: RFC: adding pytest as a supported test framework

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Andres Freund <andres@anarazel.de>
Cc: Jacob Champion <jacob.champion@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-06-11T12:04:57Z
Lists: pgsql-hackers
On 2024-06-10 Mo 21:49, Andres Freund wrote:
> Hi,
>
> On 2024-06-10 16:46:56 -0400, Andrew Dunstan wrote:
>> On 2024-06-10 Mo 16:04, Andres Freund wrote:
>>> Hi,
>>>
>>>
>>> Just for context for the rest the email: I think we desperately need to move
>>> off perl for tests. The infrastructure around our testing is basically
>>> unmaintained and just about nobody that started doing dev stuff in the last 10
>>> years learned perl.
>> Andres,
>>
>> I get that you don't like perl.
> I indeed don't particularly like perl - but that's really not the main
> issue. I've already learned [some of] it. What is the main issue is that I've
> also watched several newer folks try to write tests in it, and it was not
> pretty.


Hmm. I've done webinars in the past about how to write TAP tests for 
PostgreSQL, maybe I need to beef that up some.


>> I'm not sure what part of the testing infrastructure you think is
>> unmaintained. For example, the last release of Test::Simple was all the way
>> back on April 25.
> IPC::Run is quite buggy and basically just maintained by Noah these days.
>

Yes, that's true. I think the biggest pain point is possibly the 
recovery tests.

Some time ago I did some work on wrapping libpq using the perl FFI 
module. It worked pretty well, and would mean we could probably avoid 
many uses of IPC::Run, and would probably be substantially more 
efficient (no fork required). It wouldn't avoid all uses of IPC::Run, 
though.

But my point was mainly that while a new framework might have value, I 
don't think we need to run out and immediately rewrite several hundred 
TAP tests. Let's pick the major pain points and address those.


cheers


andrew

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