Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support
Date: 2018-02-17 13:48:24
Message-ID: 20180217134824.GA31338@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 17, 2018 at 08:34:41AM +0900, Michael Paquier wrote:
> For this an environment variable seems suited to me. Say if
> PG_TAP_ALLOW_INSECURE is set, then the tests said "insecure" are allowed
> to run. If the tests are tried to be run, then they are just skipped
> with a nice log message to tell you about it. The cool part about this
> design is that all the tests that are not part of check-world could be
> integrated in it. Most developers don't run regression tests on a
> shared resource. Let me think about a full-fledged patch first.
> Documentation also matters a lot.

Attached is what I have finished with. I have gathered the feedback
from everybody on this thread and I think that the result can satisfy
all the requirements mentioned:
- 0001 is a small patch which makes the SSL and LDAP test suite fail
immediately if the build's ./configure is not set up with necessary
build options. This uses TestLib::check_pg_config to do the checks.
- 0002 introduces a new environment variable which can be used to decide
if an extra test suite can be used or not. I have named it
PROVE_EXTRA_ALLOWED, and can be used as such:
make -C src/test check PROVE_EXTRA_ALLOWED=3D'ssl ldap'
This includes also some documentation. Note that with default settings
the tests are skipped to keep things secure.

0002 is close to the logic mentioned by Peter E just upthread. To be
more consistent with PROVE_TESTS and PROVE_FLAGS I also chose a prove
variable as that's related to TAP at the end. I am of course open to
better names.
--
Michael

Attachment Content-Type Size
0001-Prevent-SSL-and-LDAP-tests-from-running-without-supp.patch text/x-diff 2.1 KB
0002-Add-PROVE_EXTRA_ALLOWED-to-control-optional-test-sui.patch text/x-diff 6.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-02-17 14:03:05 Documenting PROVE_TESTS in section of TAP tests
Previous Message Erik Rijkers 2018-02-17 11:30:14 Re: pgbench - allow to specify scale as a size