Skip to content

Commit c91504b

Browse files
committed
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
1 parent 2e81050 commit c91504b

File tree

8 files changed

+28
-2
lines changed

8 files changed

+28
-2
lines changed

src/test/modules/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ SUBDIRS = \
1919
test_rbtree \
2020
test_rls_hooks \
2121
test_shm_mq \
22+
unsafe_tests \
2223
worker_spi
2324

2425
$(recurse)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated subdirectories
2+
/log/
3+
/results/
4+
/tmp_check/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# src/test/modules/unsafe_tests/Makefile
2+
3+
REGRESS = rolenames
4+
5+
ifdef USE_PGXS
6+
PG_CONFIG = pg_config
7+
PGXS := $(shell $(PG_CONFIG) --pgxs)
8+
include $(PGXS)
9+
else
10+
subdir = src/test/modules/unsafe_tests
11+
top_builddir = ../../../..
12+
include $(top_builddir)/src/Makefile.global
13+
include $(top_srcdir)/contrib/contrib-global.mk
14+
endif

src/test/modules/unsafe_tests/README

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This directory doesn't actually contain any extension module.
2+
3+
What it is is a home for regression tests that we don't want to run
4+
during "make installcheck" because they could have side-effects that
5+
seem undesirable for a production installation.
6+
7+
An example is that rolenames.sql tests ALTER USER ALL and so could
8+
have effects on pre-existing roles.

src/test/regress/parallel_schedule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test: create_index create_index_spgist create_view index_including index_includi
5555
# ----------
5656
# Another group of parallel tests
5757
# ----------
58-
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
58+
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
5959

6060
# ----------
6161
# sanity_check does a vacuum, affecting the sort order of SELECT *

src/test/regress/serial_schedule

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ test: typed_table
7777
test: vacuum
7878
test: drop_if_exists
7979
test: updatable_views
80-
test: rolenames
8180
test: roleattributes
8281
test: create_am
8382
test: hash_func

0 commit comments

Comments
 (0)