Convert sepgsql tests to TAP

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Convert sepgsql tests to TAP
Date: 2024-05-13 06:16:10
Message-ID: 651a5baf-5c45-4a5a-a202-0c8453a4ebf8@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The sepgsql tests have not been integrated into the Meson build system
yet. I propose to fix that here.

One problem there was that the tests use a very custom construction
where a top-level shell script internally calls make. I have converted
this to a TAP script that does the preliminary checks and then calls
pg_regress directly, without make. This seems to get the job done.
Also, once you have your SELinux environment set up as required, the
test now works fully automatically; you don't have to do any manual prep
work. The whole thing is guarded by PG_TEST_EXTRA=sepgsql now.

Some comments and questions:

- Do we want to keep the old way to run the test? I don't know all the
testing scenarios that people might be interested in, but of course it
would also be good to cut down on the duplication in the test files.

- Strangely, there was apparently so far no way to get to the build
directory from a TAP script. They only ever want to read files from the
source directory. So I had to add that.

- If you go through the pre-test checks in contrib/sepgsql/test_sepgsql,
I have converted most of these checks to the Perl script. Some of the
checks are obsolete, because they check whether the database has been
correctly initialized, which is now done by the TAP script anyway. One
check that I wasn't sure about is the

# 'psql' command must be executable from test domain

The old test was checking the installation tree, which I guess could be
set up in random ways. But do we need this kind of check if we are
using a temporary installation?

As mentioned in the patch, the documentation needs to be updated. This
depends on the outcome of the question above whether we want to keep the
old tests in some way.

Attachment Content-Type Size
v1-0001-Convert-sepgsql-tests-to-TAP.patch text/plain 10.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2024-05-13 06:34:35 Re: Slow catchup of 2PC (twophase) transactions on replica in LR
Previous Message Bharath Rupireddy 2024-05-13 05:35:40 Re: Use WALReadFromBuffers in more places