Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVu6N-009a8s-1x for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 16:10:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVu6M-00EJmk-0p for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 16:10:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVu6L-00EJmb-1C for pgsql-hackers@lists.postgresql.org; Wed, 17 Dec 2025 16:10:10 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVu6H-001G5j-2W for pgsql-hackers@postgresql.org; Wed, 17 Dec 2025 16:10:09 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id C56D0140024F; Wed, 17 Dec 2025 11:10:02 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 17 Dec 2025 11:10:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1765987802; x=1766074202; bh=RaJT+sZM6x BaEnjQ8+wHkoC8PromkDNfVwFFrrzhhwE=; b=ppCEY7FjDo8BdQpRAw8LaaORAz OKfIoMlfq7AiJ2AnjEoS0a88I87ijn11rlBdyDM8ZROCyMCS5rMC4GwuLNXxyrmj ZOnAdMetPffWssxsFvmxJ2vaogNkuNv/IbHVW5pGyyo/og2UUAPmWjfUATgN9u/S Xz2Nyv1e/A8AlHyvtVUObdrpA519AdCdry3uBry2fe4XmEbQM1c5VwTXcdmd9Nb1 rWH6gZ4tH0VILptgY1XdvJ5jF3DBN/D4/cX/iGiv35C1bADiSkS7Ar8OmXfBHiq1 Zkrw4OAnKS/abwadeauBGSv0H3o66ICjvFwLjYjLnyppkHteV/d6B8RtZIVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1765987802; x=1766074202; bh=RaJT+sZM6xBaEnjQ8+wHkoC8PromkDNfVwF FrrzhhwE=; b=ZQ7tQEWnV5yRlB2EqdvdHS6Taj9Cxrk8UdiltIiLj8b7CD4yc9J uFfAEyH7/DcvBQaX+X/p8EDfYBVRkFQVor2oauapPk3fPJY5//tC/hEYJRy+J6u+ lI4CKpdxVt4CVUvwcl7qgvZgmbxXZ3Ou3V9aJz5d+xIq3NHnyRIvhgl35edYWc68 7hiqwGh0+76ZmJpzqWQKZ6eQIkSypcLRuLV/YF8lylpKXJEm8fmpVQcxOVt10vBZ MeO1O13LN2NFjSu2BCiL05XSrtOirCrcImXBm9WV08gkIr9E92msWMz/frQPDW7g xj1HZtGpL7kakWK9gOGTqpDby7jfLfbYAlA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegfedttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpeetvdevvdetleeuleejlefhlefgvdffgefhleejlefgtdduvedvkeevgeeggfei ieenucffohhmrghinheptghirhhruhhsqdgtihdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvgdpnhgspghrtghpthhtohepkedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgpdhrtghpthhtohepjhgrtghosgdr tghhrghmphhiohhnsegvnhhtvghrphhrihhsvggusgdrtghomhdprhgtphhtthhopegshi grvhhuiiekudesghhmrghilhdrtghomhdprhgtphhtthhopehrohgsvghrthhmhhgrrghs sehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhoshhtghhrvghssehjvghlthgvfhdrnh hlpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdho rhhgpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtphhtthhope gurghnihgvlheshigvshhqlhdrshgv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Dec 2025 11:10:01 -0500 (EST) Date: Wed, 17 Dec 2025 11:10:01 -0500 From: Andres Freund To: Jelte Fennema-Nio Cc: Jacob Champion , PostgreSQL Hackers , Robert Haas , Daniel Gustafsson , Tom Lane , Peter Eisentraut , Nazir Bilal Yavuz Subject: Re: RFC: adding pytest as a supported test framework Message-ID: References: <2302192.1718380169@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-11-10 22:11:50 +0100, Jelte Fennema-Nio wrote: > On Wed Oct 22, 2025 at 2:44 PM CEST, Jelte Fennema-Nio wrote: > > So here's your patchset with an additional commit on top that does a > > bunch of refactoring/renaming and adding features. > > Rebased to fix conflicts. I assume this intentionally doesn't pass CI: https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F6045 > From f6823405eb994d457f8123df0d417ca2340e4c71 Mon Sep 17 00:00:00 2001 > From: Jacob Champion > Date: Fri, 5 Sep 2025 16:39:08 -0700 > Subject: [PATCH v3 01/10] meson: Include TAP tests in the configuration > summary > > ...to make it obvious when they've been enabled. prove is added to the > executables list for good measure. > > TODO: does Autoconf need something similar? I agree with adding tap to the configuration summary, but I don't understand the prove part, that just seems like a waste of vertical space. > From 5a27976496db53d8e9b88ab59e6c71f0f42dedcd Mon Sep 17 00:00:00 2001 > From: Jacob Champion > Date: Wed, 13 Aug 2025 10:58:56 -0700 > Subject: [PATCH v3 02/10] Add support for pytest test suites > > Specify --enable-pytest/-Dpytest=enabled at configure time. This > contains no Postgres test logic -- it is just a "vanilla" pytest > skeleton. > > I've written a custom pgtap output plugin, used by the Meson mtest > runner, to fully control what we see during CI test failures. The > pytest-tap plugin would have been preferable, but it's now in > maintenance mode, and it has problems with accidentally suppressing > important collection failures. > > test_something.py is intended to show a sample failure in the CI. > > TODOs: > - OpenBSD has an ANSI-related terminal bug, but I'm not sure if the bug > is in Cirrus, the image, pytest, Python, or readline. The TERM envvar > is unset to work around it. If this workaround is removed, a bad ANSI > escape is inserted into the pgtap output and mtest is unable to parse > it. > - The Chocolatey CI setup is subpar. Need to find a way to bless the > dependencies in use rather than pulling from pip... or maybe that will > be done by the image baker. Yes, that needs to be baked into the image. Chocolatey is catastrophically slow and unreliable. It's also just bad form to hit any service with such repeated downloads. This is true for *all* of the platforms. > +############################################################### > +# Library: pytest > +############################################################### > + > +pytest_enabled = false > +pytest = not_found_dep > + > +pytestopt = get_option('pytest') > +if not pytestopt.disabled() > + pytest = find_program(get_option('PYTEST'), native: true, required: pytestopt) > + if pytest.found() > + pytest_check = run_command(pytest, > + '-c', 'pytest.ini', > + '--confcutdir=config', > + '--capture=no', > + 'config/check_pytest.py', > + '--requirements', 'config/pytest-requirements.txt', > + check: false) > + if pytest_check.returncode() != 0 > + message(pytest_check.stderr()) > + if pytestopt.enabled() > + error('Additional Python packages are required to run the pytest suites.') > + else > + warning('Additional Python packages are required to run the pytest suites.') > + endif > + else > + pytest_enabled = true > + endif > + endif > +endif Why do we need pytest the program at all? Running the tests one-by-one with pytest as a runner doesn't seem to make a whole lot of sense to me. > diff --git a/src/test/Makefile b/src/test/Makefile > index 511a72e6238..0be9771d71f 100644 > --- a/src/test/Makefile > +++ b/src/test/Makefile > @@ -12,7 +12,16 @@ subdir = src/test > top_builddir = ../.. > include $(top_builddir)/src/Makefile.global > > -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 think it'd be a seriously bad idea to start with no central infrastructure, we'd be force to duplicate that all over. Eventually we'll be forced to introduce some central infrastructure, but we'll probably not go around and carefully go through the existing tests for stuff that should now use the common infrastructure. Greetings, Andres Freund