pgsql: Add an enforcement mechanism for global object names inregressi

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Add an enforcement mechanism for global object names inregressi
Дата
Msg-id E1hhFMg-0006BG-Jd@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Add an enforcement mechanism for global object names in regression tests.

In commit 18555b132 we tentatively established a rule that regression
tests should use names containing "regression" for databases, and names
starting with "regress_" for all other globally-visible object names, so
as to circumscribe the side-effects that "make installcheck" could have
on an existing installation.

This commit adds a simple enforcement mechanism for that rule: if the code
is compiled with ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS defined, it
will emit a warning (not an error) whenever a database, role, tablespace,
subscription, or replication origin name is created that doesn't obey the
rule.  Running one or more buildfarm members with that symbol defined
should be enough to catch new violations, at least in the regular
regression tests.  Most TAP tests wouldn't notice such warnings, but
that's actually fine because TAP tests don't execute against an existing
server anyway.

Since it's already the case that running src/test/modules/ tests in
installcheck mode is deprecated, we can use that as a home for tests
that seem unsafe to run against an existing server, such as tests that
might have side-effects on existing roles.  Document that (though this
commit doesn't in itself make it any less safe than before).

Update regress.sgml to define these restrictions more clearly, and
to clean up assorted lack-of-up-to-date-ness in its descriptions of
the available regression tests.

Discussion: https://postgr.es/m/16638.1468620817@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/54100f5c6052404f68de9ce7310ceb61f1c291f8

Modified Files
--------------
doc/src/sgml/regress.sgml                | 105 +++++++++++++++++++++++++------
src/backend/commands/alter.c             |   6 ++
src/backend/commands/dbcommands.c        |  19 ++++++
src/backend/commands/subscriptioncmds.c  |   9 +++
src/backend/commands/tablespace.c        |  18 ++++++
src/backend/commands/user.c              |  18 ++++++
src/backend/replication/logical/origin.c |   9 +++
src/test/modules/README                  |   7 +++
8 files changed, 172 insertions(+), 19 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Remove unnecessary header from be-secure-gssapi.c
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Don't call data type input functions in GUC check hooks