Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions HISTORY.asc
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
1.0.0
-----
== Use unique database names for tests
Tests now use a unique database name based on the project name and a hash of the current directory. This prevents test conflicts when running tests for multiple projects in parallel.

== Add 3-way merge support for setup files after pgxntool-sync
New `update-setup-files.sh` script handles merging changes to files initially copied by `setup.sh` (`.gitignore`, `test/deps.sql`). After running `make pgxntool-sync`, the script performs a 3-way merge if both you and pgxntool have modified the same file, using git's native conflict markers for resolution.

== Fix broken multi-extension support
Prior to this fix, distributions with multiple extensions or extensions with versions different from the PGXN distribution version were completely broken. Extension versions are now correctly read from each `.control` file's `default_version` instead of using META.json's distribution version.

Expand Down
9 changes: 9 additions & 0 deletions base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ TEST__SOURCE__SQL_FILES = $(patsubst $(TESTDIR)/input/%.source,$(TESTDIR)/sql/%
TEST__SOURCE__EXPECTED_FILES = $(patsubst $(TESTDIR)/output/%.source,$(TESTDIR)/expected/%.out,$(TEST__SOURCE__OUTPUT_FILES))
REGRESS = $(sort $(notdir $(subst .source,,$(TEST_FILES:.sql=)))) # Sort is to get unique list
REGRESS_OPTS = --inputdir=$(TESTDIR) --outputdir=$(TESTOUT) # See additional setup below

# Generate unique database name for tests to prevent conflicts across projects
# Uses project name + first 5 chars of md5 hash of current directory
# This prevents multiple test runs in different directories from clobbering each other
REGRESS_DBHASH := $(shell echo $(CURDIR) | (md5 2>/dev/null || md5sum) | cut -c1-5)
REGRESS_DBNAME := $(or $(PGXN),regression)_$(REGRESS_DBHASH)
REGRESS_OPTS += --dbname=$(REGRESS_DBNAME)
MODULES = $(patsubst %.c,%,$(wildcard src/*.c))
ifeq ($(strip $(MODULES)),)
MODULES =# Set to NUL so PGXS doesn't puke
Expand Down Expand Up @@ -306,8 +313,10 @@ pgxntool-sync: pgxntool-sync-release
# could make resolving merges difficult!
pgxntool-sync-release := git@github.com:decibel/pgxntool.git release
pgxntool-sync-stable := git@github.com:decibel/pgxntool.git stable
pgxntool-sync-master := git@github.com:decibel/pgxntool.git master
pgxntool-sync-local := ../pgxntool release # Not the same as PGXNTOOL_DIR!
pgxntool-sync-local-stable := ../pgxntool stable # Not the same as PGXNTOOL_DIR!
pgxntool-sync-local-master := ../pgxntool master # Not the same as PGXNTOOL_DIR!

distclean:
rm -f $(PGXNTOOL_distclean)
Expand Down