Re: Python/pytest test framework take two

From: "Jelte Fennema-Nio" <me(at)jeltef(dot)nl>
To: "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "Andres Freund" <andres(at)anarazel(dot)de>, "Jacob Champion" <jacob(dot)champion(at)enterprisedb(dot)com>, "Aleksander Alekseev" <aleksander(at)tigerdata(dot)com>, "Xuneng Zhou" <xunengzhou(at)gmail(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Gregory Burd" <greg(at)burd(dot)me>, "Melanie Plageman" <melanieplageman(at)gmail(dot)com>, "shihao zhong" <zhong950419(at)gmail(dot)com>
Subject: Re: Python/pytest test framework take two
Date: 2026-10-28 21:33:16
Message-ID: DMGSKK1XAEBJ.2I8XZ0MXQCXP0@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 19 Aug 2026 at 10:59, Jelte Fennema-Nio <me(at)jeltef(dot)nl> wrote:
> The patches in the patchset have detailed commit messages. But here's a
> short summary per patch:
> 0001: Small patch to make meson CI output better in general by not
> truncating error logs as much
> 0002: Small meson refactoring, moving a magic number into a variable
> 0003: Installing 32-bit python, can be removed after pg-vm-images PR is
> merged
> 0004: Basic pytest support for the build system and CI.
> 0005: Introduction of the actual framework that can manage Postgres
> servers and send queries
> 0006-0007: Two short converted tests that run much faster using this
> framework
> 0008: Shows off the background_sql functionality, which is much easier
> to use and more robust than Perl its background_psql
> 0009: Conversion of the 001_aio test, which is the most unreadable Perl
> test I could find (sorry Andres). It becomes, less buggy, more
> readable (imo), shorter and faster when written in Python.
> 0010-0012: Some more tests that are faster and/or easier to read+write
> in Python.

Attached is an updated version of the patchset that rebases and makes
the following changes:

- Much shorter failure output: --tb=short, only the last 30 server log
lines, pg_ctl --silent, framework internals hidden from tracebacks,
and a clearer error for unconsumed background query results. CI's
--max-lines is lowered to 500.
- Uncaught server errors show DETAIL, HINT, QUERY, CONTEXT and LOCATION.
- log_contains() can wait for a line and accepts a list of patterns.
- New require_extension() and friends, like Perl's check_extension().
- Server config, environment and locale now match the Perl TAP tests
(wal_level = minimal by default, TEMP_CONFIG,
PG_TEST_INITDB_EXTRA_OPTS, etc.).
- log_line_prefix includes the backend type.
- POC ports use log_contains(..., wait=True), and 049_wait_for_lsn and
031_recovery_conflict are rebased onto upstream changes.

Attachment Content-Type Size
v2-0001-ci-show-more-than-100-lines-of-a-failing-test-s-l.patch text/x-patch 1.6 KB
v2-0002-meson-Deduplicate-test-timeout-into-a-variable.patch text/x-patch 2.5 KB
v2-0003-ci-temporarily-install-a-32-bit-Python-in-the-32-.patch text/x-patch 3.0 KB
v2-0004-Add-support-for-pytest-test-suites.patch text/x-patch 34.6 KB
v2-0005-Add-pytest-infrastructure-to-interact-with-Postgr.patch text/x-patch 175.3 KB
v2-0006-POC-amcheck-port-TAP-test-001_verify_heapam-to-py.patch text/x-patch 17.4 KB
v2-0007-POC-test_json_parser-port-TAP-test-002_inline-to-.patch text/x-patch 13.7 KB
v2-0008-POC-recovery-port-TAP-test-049_wait_for_lsn-to-py.patch text/x-patch 99.3 KB
v2-0009-POC-test_aio-port-TAP-test-001_aio-to-pytest.patch text/x-patch 106.4 KB
v2-0010-POC-recovery-port-TAP-test-029_stats_restart-to-p.patch text/x-patch 22.9 KB
v2-0011-POC-recovery-port-TAP-test-031_recovery_conflict-.patch text/x-patch 25.4 KB
v2-0012-POC-subscription-port-TAP-test-031_column_list-to.patch text/x-patch 83.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message surya poondla 2026-10-28 21:33:33 Re: Be strict when request to flush past end of WAL in WaitXLogInsertionsToFinish
Previous Message Iliia Khaprov 2026-10-28 21:31:53 inet/cidr: IPv4 prefix length overflows int and passes the range check