From c91504b958e1647f87ffb7168e61db75ca09b928 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 30 Jun 2019 12:51:08 -0400 Subject: [PATCH] Move rolenames test out of the core regression tests. This test script is unsafe to run in "make installcheck" mode for (at least) two reasons: it creates and destroys some role names that don't follow the "regress_xxx" naming convention, and it sets and then resets the application_name GUC attached to every existing role. While we've not had complaints, these surely are not good things to do within a production installation, and regress.sgml pretty clearly implies that we won't do them. Rather than lose test coverage altogether, let's just move this script somewhere where it will get run by "make check" but not "make installcheck". src/test/modules/ already has that property. Since it seems likely that we'll want other regression tests in future that also exceed the constraints of "make installcheck", create a generically-named src/test/modules/unsafe_tests/ directory to hold them. Discussion: https://postgr.es/m/16638.1468620817@sss.pgh.pa.us --- src/test/modules/Makefile | 1 + src/test/modules/unsafe_tests/.gitignore | 4 ++++ src/test/modules/unsafe_tests/Makefile | 14 ++++++++++++++ src/test/modules/unsafe_tests/README | 8 ++++++++ .../unsafe_tests}/expected/rolenames.out | 0 .../unsafe_tests}/sql/rolenames.sql | 0 src/test/regress/parallel_schedule | 2 +- src/test/regress/serial_schedule | 1 - 8 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/test/modules/unsafe_tests/.gitignore create mode 100644 src/test/modules/unsafe_tests/Makefile create mode 100644 src/test/modules/unsafe_tests/README rename src/test/{regress => modules/unsafe_tests}/expected/rolenames.out (100%) rename src/test/{regress => modules/unsafe_tests}/sql/rolenames.sql (100%) diff --git a/src/test/modules/Makefile b/src/test/modules/Makefile index dfd0956aee3..60d6d7be1b2 100644 --- a/src/test/modules/Makefile +++ b/src/test/modules/Makefile @@ -19,6 +19,7 @@ SUBDIRS = \ test_rbtree \ test_rls_hooks \ test_shm_mq \ + unsafe_tests \ worker_spi $(recurse) diff --git a/src/test/modules/unsafe_tests/.gitignore b/src/test/modules/unsafe_tests/.gitignore new file mode 100644 index 00000000000..5dcb3ff9723 --- /dev/null +++ b/src/test/modules/unsafe_tests/.gitignore @@ -0,0 +1,4 @@ +# Generated subdirectories +/log/ +/results/ +/tmp_check/ diff --git a/src/test/modules/unsafe_tests/Makefile b/src/test/modules/unsafe_tests/Makefile new file mode 100644 index 00000000000..321252f8d51 --- /dev/null +++ b/src/test/modules/unsafe_tests/Makefile @@ -0,0 +1,14 @@ +# src/test/modules/unsafe_tests/Makefile + +REGRESS = rolenames + +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else +subdir = src/test/modules/unsafe_tests +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif diff --git a/src/test/modules/unsafe_tests/README b/src/test/modules/unsafe_tests/README new file mode 100644 index 00000000000..a7e5b2a04f5 --- /dev/null +++ b/src/test/modules/unsafe_tests/README @@ -0,0 +1,8 @@ +This directory doesn't actually contain any extension module. + +What it is is a home for regression tests that we don't want to run +during "make installcheck" because they could have side-effects that +seem undesirable for a production installation. + +An example is that rolenames.sql tests ALTER USER ALL and so could +have effects on pre-existing roles. diff --git a/src/test/regress/expected/rolenames.out b/src/test/modules/unsafe_tests/expected/rolenames.out similarity index 100% rename from src/test/regress/expected/rolenames.out rename to src/test/modules/unsafe_tests/expected/rolenames.out diff --git a/src/test/regress/sql/rolenames.sql b/src/test/modules/unsafe_tests/sql/rolenames.sql similarity index 100% rename from src/test/regress/sql/rolenames.sql rename to src/test/modules/unsafe_tests/sql/rolenames.sql diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index f23fe8d870e..8fb55f045e6 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -55,7 +55,7 @@ test: create_index create_index_spgist create_view index_including index_includi # ---------- # Another group of parallel tests # ---------- -test: create_aggregate create_function_3 create_cast constraints triggers select inherit typed_table vacuum drop_if_exists updatable_views rolenames roleattributes create_am hash_func errors +test: create_aggregate create_function_3 create_cast constraints triggers select inherit typed_table vacuum drop_if_exists updatable_views roleattributes create_am hash_func errors # ---------- # sanity_check does a vacuum, affecting the sort order of SELECT * diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule index ca200eb5997..a39ca1012a3 100644 --- a/src/test/regress/serial_schedule +++ b/src/test/regress/serial_schedule @@ -77,7 +77,6 @@ test: typed_table test: vacuum test: drop_if_exists test: updatable_views -test: rolenames test: roleattributes test: create_am test: hash_func