PostgreSQL removed .source file processing from pg_regress in PG15.
The input/.source → sql/.sql and output/.source →
expected/.out conversion mechanism no longer functions. All related
variables (TESTSOURCE*), the make_results.sh helper script, and
the special-case logic in make results have been removed. Extensions
that used .source files should convert them to regular test/sql/.sql
and test/expected/.out files using relative paths.
When CREATE EXTENSION fails due to a SQL syntax error, PostgreSQL reports only a cryptic error with limited context. test-build runs your extension SQL directly through pg_regress first, so syntax errors show the exact file, line, and position — cutting debugging time significantly. Place SQL files in test/build/ to enable; auto-detects based on file presence.
Extensions that install dependencies or run expensive setup in every test file pay that cost once per test. test/install runs setup SQL once before the entire test suite, and all regular tests share the resulting database state. This can dramatically speed up test suites that install extensions or load fixtures. Place SQL files in test/install/ to enable; auto-detects based on file presence.
make results now refuses to run when tests are failing (detected via regression.diffs). Prevents accidentally blessing incorrect output as the new expected results. Enabled by default; disable with PGXNTOOL_ENABLE_VERIFY_RESULTS=no.
${ARRAY[@]:-0} is a syntax error in bash 3.2; replaced with ${#ARRAY[@]}.
Shell scripts now use !/usr/bin/env bash.
The unique database naming introduced in 1.1.0 was ineffective because base.mk added --dbname=$(REGRESS_DBNAME) to REGRESS_OPTS while PGXS also appends --dbname=$(CONTRIB_TESTDB). The second --dbname caused pg_regress to create a contrib_regression database that collided across projects. Fixed by overriding CONTRIB_TESTDB after include $(PGXS) instead.
The exception handler for uninstall_extension() now correctly catches
no_data_found (P0002) instead of undefined_object (42704). Empty upgrade
files are now treated as valid no-op upgrades for version bumps. Added
ON_ERROR_STOP=1 to run_pgtle_sql() so psql errors propagate correctly.
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.
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.
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.
New make pgtle target generates pg_tle registration SQL for extensions.
Supports pg_tle version ranges (1.0.0-1.4.0, 1.4.0-1.5.0, 1.5.0+) with
appropriate API calls for each range. See README for usage.
The tag and rmtag targets now create/delete git tags instead of branches.
As part of this change, you will want to review the changes to test/deps.sql.
By default, if asciidoctor or asciidoc exists on the system, any files in doc/ that end in .adoc or .asciidoc will be processed to html.
See the README for full details.
If a test input file changes we certainly need to re-run tests.
Paul Norman #3
Having the tap stuff in deps.sql was confusing because it was also loaded by setup.sql. Just let setup.sql handle it, as that’s what most people should probably do. At some point we’ll probably need a way to over-ride this though…
This is necessary because some install targets are generated and would not necessarily be on the filesystem when we installed. This also prevents installing leftover cruft from old versions.