Re: RFC: adding pytest as a supported test framework

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Jacob Champion" <jacob(dot)champion(at)enterprisedb(dot)com>, "Andres Freund" <andres(at)anarazel(dot)de>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Daniel Gustafsson" <daniel(at)yesql(dot)se>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter(at)eisentraut(dot)org>, "Nazir Bilal Yavuz" <byavuz81(at)gmail(dot)com>
Subject: Re: RFC: adding pytest as a supported test framework
Date: 2026-01-06 19:07:22
Message-ID: DFHQQ4VS43SU.25NN2Y5GDWANL@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon Jan 5, 2026 at 9:19 PM CET, Jacob Champion wrote:
> On Wed, Dec 17, 2025 at 8:10 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> Before it gets too far away from me: note that I have not yet been
> able to get up to speed with the combined refactoring+feature patch
> that Jelte added in v3, and it's now up to v7,

Attached is v8. It simplifies the Cirrus CI yaml, because the
dependencies are now baked into the images. I also removed the optional
dependency on uv. Meson/autoconf now simply search for pytest binary in
the .venv directory too. Devs can then choose if they want to populate
.venv with pip or uv. Finally, if the pytest binary cannot be found,
there's a fallback attempt to use `python -m pytest`.

> That's fine by me, but I plan to focus on
> things that need to get into PG19 before I focus on this, since
> nothing is really blocked on it.

Part of the reason why I've been trying to push this forward is that
automated tests for the GoAway patch are definitely blocked on this. (The
other reason is that I'd like to reduce the amount of perl I have to
read/write.)

>> > -SUBDIRS = perl postmaster regress isolation modules authentication recovery subscription
>> > +SUBDIRS = \
>> > + authentication \
>> > + isolation \
>> > + modules \
>> > + perl \
>> > + postmaster \
>> > + pytest \
>> > + recovery \
>> > + regress \
>> > + subscription
>>
>> I'm onboard with that, but we should do it separately and probably check for
>> other cases where we should do it at the same time.
>
> I'm not sure what context this is referring to? What are you on board with?

If I understood Andres correctly this was about splitting the items
across multiple lines. I moved this to a separate thread, and it was
cammitted by Michael in 9adf32da6b. So this has been resolved afaik.

>> I think it'd be a seriously bad idea to start with no central infrastructure,
>> we'd be force to duplicate that all over.
>
> Right, I just want central infra to be pulled out of the new tests
> that need them rather than the other way around.

I'm not sure how you expect that to work in practice. I believe (and I
think Andres too) that there's some infra that we already know we'll
need for many tests, e.g. starting/stopping nodes, running queries,
handling errors. I don't think it makes sense to have those be pulled
out of new tests. You need some basics, otherwise no-one will want to
write tests. And even if they do, everyone ends up with different styles
of doing basic things. I'd rather coordinate on a bit of style upront so
that tests behave similarly for common usages.

Attachment Content-Type Size
v8-0001-meson-Include-TAP-tests-in-the-configuration-summ.patch text/x-patch 1.1 KB
v8-0002-Add-support-for-pytest-test-suites.patch text/x-patch 28.8 KB
v8-0003-ci-Add-MTEST_SUITES-for-optional-test-tailoring.patch text/x-patch 3.1 KB
v8-0004-Add-pytest-infrastructure-to-interact-with-Postgr.patch text/x-patch 134.6 KB
v8-0005-Convert-load-balance-tests-from-perl-to-python.patch text/x-patch 16.9 KB
v8-0006-WIP-pytest-Add-some-SSL-client-tests.patch text/x-patch 16.9 KB
v8-0007-WIP-pytest-Add-some-server-side-SSL-tests.patch text/x-patch 8.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marcos Pegoraro 2026-01-06 19:11:11 Re: Document NULL
Previous Message Marcos Pegoraro 2026-01-06 18:53:49 [PATCH] Change "the empty string" to "an empty string" on DOCs