Extend pg-tle-test to cover the update path - #24
Conversation
Adds a second scratch database to the pg-tle-test job (created after the existing template1 pg_tle registration, so it inherits it too): installs count_nulls at 0.9.6, ALTER EXTENSION UPDATEs to current, and runs the pgTAP suite in existing mode against it - proving the update path, not just a fresh install, never touches the filesystem when deployed via pg_tle. Bracketed with the same bin/assert_fs_clean verify calls as every other step in this job. bin/test_existing's run_suite() unconditionally called `make test` / `make verify-results`, and pgxntool's `test` target unconditionally depends on `install` (a real filesystem install) - reusing run_suite as-is here would have silently filesystem-installed count_nulls, defeating the point of proving pg_tle-only deployment. Added a TEST_EXISTING_DEPLOY=pgtle environment switch so run_suite instead calls `make testdeps` + `make installcheck` directly (neither depends on `install`) and runs pgxntool/verify-results-pgtap.sh's pass/fail check directly, bypassing the `test`-target dependency chain. Verified locally (PG17, filesystem-installed count_nulls as a stand-in for pg_tle - no pg_tle install available in this shared container) that the new mode never re-triggers `install` (confirmed via count_nulls.control's mtime), while the default mode still does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Real CI on the update-path leg of pg-tle-test found that pg_available_extensions never sees pg_tle-registered extensions - it only reads .control files off disk - so its default_version comes back NULL under a pg_tle deployment even though CREATE EXTENSION correctly resolves through pg_tle's own catalog. Confirmed against pg_tle's tleextension.c (v1.5.2): pg_available_extensions is only ever described there as modeled on pgtle.available_extensions(), never hooked to it. Add a TEST_EXISTING_DEPLOY-driven GUC (count_nulls.test_existing_deploy, default 'filesystem') so test/deps.sql's existing-mode cross-check can pick the right source: pg_available_extensions for filesystem installs (unchanged strictness) or pgtle.available_extensions() when TEST_EXISTING_DEPLOY=pgtle. Reuses the same env var name bin/test_existing already reads, so no new plumbing is needed to get it into the make invocations it spawns. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Stacked on #23, so closing alongside it. The pg_tle/pg_available_extensions bug found here is real and will be ported forward into the new design's pg_tle phase. |
PR #23 (add-update-upgrade-testing) built the extension-update/pg_upgrade
test harness (bin/test_existing, TEST_LOAD_SOURCE/TEST_SCHEMA, the
extension-update-test and pg-upgrade-test CI jobs) and, separately, an
earlier pg-tle-test job (#16) proved count_nulls installs and works when
registered through AWS pg_tle's database-backed catalog instead of a
filesystem .control file - but only for a FRESH install. This PR closes that
gap: pg-tle-test now also exercises the 0.9.6 -> current update path through
pg_tle, not just a fresh install.
Stacks on #23 (base branch add-update-upgrade-testing, not master) since it
needs bin/test_existing, which only exists there. Should be rebased onto
master once #23 merges.
What's new here vs. #23: a second scratch database, created after the
existing job's
template1pg_tle registration (so it inherits it too,same reasoning as the existing fresh-install smoke-test db) - installs
count_nulls at 0.9.6, ALTER EXTENSION UPDATEs it to current, and runs the
pgTAP suite against it in existing mode (bin/test_existing's
update-scenario subcommand, unmodified - it's already pg_tle-transparent
once the target database descends from the pg_tle-registered template1).
Bracketed with the same bin/assert_fs_clean verify calls as every other
step in this job, so the whole update-path run is proven to never write a
filesystem control file either.
The one piece of new plumbing needed in bin/test_existing itself:
run_suite() unconditionally called
make test/make verify-results, andpgxntool's
testtarget unconditionally depends oninstall(a realfilesystem install) - reusing run_suite as-is here would have silently
filesystem-installed count_nulls, defeating the entire point of proving
pg_tle-only deployment. Added a
TEST_EXISTING_DEPLOY=pgtleenvironmentswitch, read only by run_suite: in that mode it calls
make testdeps+make installcheckdirectly instead (verified against pgxntool/base.mk thatneither depends on
install- onlytestdoes, viaTEST_DEPS += install installcheck), then runspgxntool/verify-results-pgtap.sh directly against the results - the same
pass/fail check
make verify-resultsruns, but the script itself onlytakes TESTOUT as an argument and has no dependency on the
testtarget, socalling it directly gets the same logic without going through the
test-target dependency chain. Everything else in bin/test_existing (createat 0.9.6, plant/prove the guard, ALTER EXTENSION UPDATE) needed no changes.
Validated locally on this container's live PG17 cluster (no local pg_tle
install attempted - modifying this shared cluster's
shared_preload_libraries felt too risky with other sessions potentially
running in parallel, so this substituted a real filesystem-installed
count_nulls as a stand-in for pg_tle to validate the TEST_EXISTING_DEPLOY
plumbing itself): confirmed
TEST_EXISTING_DEPLOY=pgtle bin/test_existing update-scenario ... 0.9.6runs the full update-scenario flow (guardplanted and proven, ALTER EXTENSION UPDATE, pgTAP suite passing in existing
mode) end to end, and - checking count_nulls.control's mtime before/after -
confirmed the pgtle-mode call never re-triggers
install, while thedefault (unset TEST_EXISTING_DEPLOY) mode still does, as expected. The real
pg_tle-registered version of this will need a genuine CI run to confirm.
Bug found from real CI, not caught locally: the update-path leg above failed
on its first real CI run. test/deps.sql's existing-mode assertion compares
pg_extension.extversion against pg_available_extensions.default_version, but
pg_available_extensions only ever reads .control files directly off disk -
it has no knowledge of pg_tle's separate, database-backed registration
catalog. Under this job's pg_tle-only deployment, default_version came back
NULL even though the earlier fresh-install smoke test in the SAME job proves
a version-less CREATE EXTENSION correctly resolves the current version
through pg_tle - that smoke test just never happens to touch
pg_available_extensions itself, only pg_extension.extversion, so this is the
first time this particular cross-check has ever run against a real
pg_tle-registered database. Confirmed against pg_tle's own tleextension.c
(v1.5.2, aws/pg_tle): pg_available_extensions is only ever described there as
modeled on pgtle.available_extensions() ("The system view
pg_available_extensions provides a user interface to this SRF") - pg_tle
never hooks or populates the real view, it only ships its own separate,
non-integrated analog function in the pgtle schema.
Fixed by adding a TEST_EXISTING_DEPLOY-driven GUC
(count_nulls.test_existing_deploy, default 'filesystem', reusing the env var
name bin/test_existing already reads) so test/deps.sql's existing-mode
cross-check picks the right source: pg_available_extensions for filesystem
installs (unchanged, still exactly as strict as before) or
pgtle.available_extensions() when TEST_EXISTING_DEPLOY=pgtle. Verified
locally against both branches with a stub pgtle.available_extensions()
function (real pg_tle isn't installed in this container): matching version
passes, a NULL/mismatched version still fails loudly, and the filesystem
branch is untouched.
🤖 Generated with Claude Code