From cc75a04206d56a118cb320469d17fc3ef985e8df Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Thu, 6 Aug 2026 17:41:08 -0500 Subject: [PATCH 1/3] Migrate zzz_build.sql to pgxntool's native test/build feature zzz_build.sql hand-rolled exactly what pgxntool's test/build/ already does natively: run the raw install script directly (not via CREATE EXTENSION) for better error messages than a bare CREATE EXTENSION failure. Postgres-Extensions/cat_tools already made this exact move. Also fixes the flaky expected-output problem that came with the old approach: zzz_build.sql ran client_min_messages unsuppressed, so its expected output captured verbose, PG-minor-version-dependent NOTICEs (e.g. "%TYPE converted to ..." with a source-file LOCATION line) -- any environment/PG-version drift showed as a spurious diff. test/build runs as its own separate installcheck invocation with client_min_messages = WARNING (matching cat_tools's own build.sql), so the expected output is stable and empty. PGXNTOOL_ENABLE_TEST_BUILD set explicitly (yes) rather than left to auto-detect, so an accidental future deletion of test/build/'s contents is a hard error instead of the check silently vanishing. --- Makefile | 5 +++++ test/build/build.sql | 20 +++++++++++++++++++ .../expected/build.out} | 2 -- test/sql/zzz_build.sql | 12 ----------- 4 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 test/build/build.sql rename test/{expected/zzz_build.out => build/expected/build.out} (96%) delete mode 100644 test/sql/zzz_build.sql diff --git a/Makefile b/Makefile index 07a0f45..cce47d3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ include pgxntool/base.mk +# Explicit rather than relying on auto-detect (which enables this whenever +# test/build/*.sql exists) so an accidental deletion of test/build/'s +# contents is a hard error instead of the check silently disappearing. +PGXNTOOL_ENABLE_TEST_BUILD = yes + testdeps: test_extension test_extension: $(DESTDIR)$datadir)/extension/extension_drop_test.control $(wildcard $(TESTDIR)/*) $(DESTDIR)$datadir)/extension/extension_drop_test.control: diff --git a/test/build/build.sql b/test/build/build.sql new file mode 100644 index 0000000..ac3fbb6 --- /dev/null +++ b/test/build/build.sql @@ -0,0 +1,20 @@ +\set ECHO none +BEGIN; +\i test/pgxntool/psql.sql + +CREATE EXTENSION IF NOT EXISTS cat_tools; + +/* + * Suppress NOTICEs from the raw install script itself (e.g. "%TYPE converted + * to ..." with a version-specific source-file LOCATION line) so this file's + * expected output stays stable across PostgreSQL minor versions instead of + * capturing verbose, version-dependent messages. + */ +SET client_min_messages = WARNING; + +\echo +\echo INSTALL +\t +\i sql/extension_drop.sql + +\echo # TRANSACTION INTENTIONALLY LEFT OPEN diff --git a/test/expected/zzz_build.out b/test/build/expected/build.out similarity index 96% rename from test/expected/zzz_build.out rename to test/build/expected/build.out index c66ee3c..44215eb 100644 --- a/test/expected/zzz_build.out +++ b/test/build/expected/build.out @@ -19,6 +19,4 @@ INSTALL - - # TRANSACTION INTENTIONALLY LEFT OPEN diff --git a/test/sql/zzz_build.sql b/test/sql/zzz_build.sql deleted file mode 100644 index 354c480..0000000 --- a/test/sql/zzz_build.sql +++ /dev/null @@ -1,12 +0,0 @@ -\set ECHO none -BEGIN; -\i test/pgxntool/psql.sql - -CREATE EXTENSION IF NOT EXISTS cat_tools; - -\echo -\echo INSTALL -\t -\i sql/extension_drop.sql - -\echo # TRANSACTION INTENTIONALLY LEFT OPEN From aadd55689427e344e8f25da79901231a007b9278 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Thu, 6 Aug 2026 18:33:40 -0500 Subject: [PATCH 2/3] test/build/build.sql: comment clarifying the dependency install line --- test/build/build.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/build/build.sql b/test/build/build.sql index ac3fbb6..3ef97d4 100644 --- a/test/build/build.sql +++ b/test/build/build.sql @@ -2,6 +2,9 @@ BEGIN; \i test/pgxntool/psql.sql +-- Install dependencies (via CREATE EXTENSION, not \i -- this is a real, +-- already-published dependency being installed normally, not the extension +-- whose raw install script this file exists to test line-by-line below). CREATE EXTENSION IF NOT EXISTS cat_tools; /* From d2449e8148e85a99d2cd8eff014550f6b12e5fbc Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Thu, 6 Aug 2026 19:19:10 -0500 Subject: [PATCH 3/3] test/build/build.sql: match file's /* */ comment convention The dependency-install comment used stacked -- lines while the NOTICE-suppression comment right below it uses a /* */ block; make them consistent, and drop the confusing "not \i --" line that read like a nested comment marker. --- test/build/build.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/build/build.sql b/test/build/build.sql index 3ef97d4..bf3de74 100644 --- a/test/build/build.sql +++ b/test/build/build.sql @@ -2,9 +2,11 @@ BEGIN; \i test/pgxntool/psql.sql --- Install dependencies (via CREATE EXTENSION, not \i -- this is a real, --- already-published dependency being installed normally, not the extension --- whose raw install script this file exists to test line-by-line below). +/* + * Install dependencies via CREATE EXTENSION, not \i: this is a real, + * already-published dependency being installed normally, not the extension + * whose raw install script this file exists to test line-by-line below. + */ CREATE EXTENSION IF NOT EXISTS cat_tools; /*