Skip to content

Commit 513e546

Browse files
committed
Add mode where contrib installcheck runs each module in a separately named database.
Normally each module is tested in aq database named contrib_regression, which is dropped and recreated at the beginhning of each pg_regress run. This mode, enabled by adding USE_MODULE_DB=1 to the make command line, runs most modules in a database with the module name embedded in it. This will make testing pg_upgrade on clusters with the contrib modules a lot easier. Still to be done: adapt to the MSVC build system. Backpatch to 9.0, which is the earliest version it is reasonably possible to test upgrading from.
1 parent 31ab893 commit 513e546

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

contrib/dblink/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ DATA = dblink--1.0.sql dblink--unpackaged--1.0.sql
1111

1212
REGRESS = dblink
1313

14+
# the db name is hard-coded in the tests
15+
override undefine USE_MODULE_DB
16+
1417
ifdef USE_PGXS
1518
PG_CONFIG = pg_config
1619
PGXS := $(shell $(PG_CONFIG) --pgxs)

src/Makefile.global.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,15 @@ submake-libpgport:
431431

432432
PL_TESTDB = pl_regression
433433
CONTRIB_TESTDB = contrib_regression
434+
ifneq ($(MODULE_big),)
435+
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
436+
else
437+
ifneq ($(MODULES),)
438+
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
439+
else
440+
CONTRIB_TESTDB_MODULE = contrib_regression
441+
endif
442+
endif
434443

435444
ifdef NO_LOCALE
436445
NOLOCALE += --no-locale

src/makefiles/pgxs.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ distclean maintainer-clean: clean
230230
ifdef REGRESS
231231

232232
# Select database to use for running the tests
233-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
233+
ifdef USE_MODULE_DB
234+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE)
235+
else
236+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
237+
endif
234238

235239
# where to find psql for running the tests
236240
PSQLDIR = $(bindir)

0 commit comments

Comments
 (0)