Adopt test/install, decoupling installation from the test suite - #27
Adopt test/install, decoupling installation from the test suite#27jnasbyupgrade wants to merge 14 commits into
Conversation
a6d3287 Release 2.3.0 (#89) 1a7ee20 CLAUDE.md: fix pre-existing documentation-accuracy errors (#88) 35fd187 Fix DATA wildcard skipping historical full-install version scripts (#48) (#80) f9ce2a2 Fix installcheck running before install; make test now fails on regressions (#83) 3ceb930 Rename PGTLE_VERSION to PGXNTOOL_PGTLE_VERSION (#85) 2de8429 claude-code-review.yml: add missing --comment flag (#84) 957bdf6 Restrict @claude mention trigger to a trusted account (#82) b67064b Release 2.2.0 (#77) d949d6d Fix stale README/CLAUDE.md docs; rename internal-only test shim (#76) 6d7822c ci: grant actions:write so bun cache save succeeds (#75) 2738f59 README.asc: fix stale docs, document undocumented API surface (#74) d1d3bee Add make pgxntool-version to print the embedded pgxntool version (#73) 493a0f8 Fix parallel-build SQL corruption, remote hardcoding, and add safety checks (#61) 3b0e3de Fix make pgtle PGTLE_VERSION=X being silently ignored (#66) 21b35ef ci: skip paired-test-PR requirement for doc-only PRs (#71) 55efd03 Rename EXTENSION_VERSION_FILES to EXTENSION__CURRENT_VERSION__FILES (#69) 9d0a856 Fix pgtle.sh rejecting non-numeric version aliases like 'stable' (#57) (#63) 9c2f75f Docs: versioned SQL file tracking tradeoffs and update-testing pattern (#60) c38cf2a ci: never check out fork PR head in claude-code-review pull_request_target job (#70) aab8f2b pgtle_versions.md: fix wrong uninstall_extension() version claim (#59) e2c9174 README.asc: make tag creates a git tag, not a branch (#58) eb84bc6 Stamp 2.1.0 9fbe6f4 Fix results ordering, control file whitespace, ENABLE_* override, debug levels (#31) 88bb4f2 Add Claude Code GitHub Actions workflows (#41) af5bbbb ci: pass repo owners to run-tests.yml for fork-account matching (#40) c7928af Fix repo-root guard to work inside a git worktree (#39) b062fca ci: point reusable test workflow at @master b6cdbfd Add CI workflows and multi-session PR guard (#33) 1ba0987 Stamp 2.0.3 1931cbe Fix pgxntool-sync remote and make it runnable without make (#37) 8176304 Stamp 2.0.2 3e142ab Fix parse_control_file: remove comments before stripping quotes (#27) cacc301 Stamp 2.0.1 bf1db6b Fix bash 3.2 / Linux compatibility issues (#26) 62d0fcb Fix broken ifeq for --load-language=plpgsql on PG < 13 (#24) 121f0b3 Stamp 2.0.0 ad3ca7e Remove .source support; add test/install, test/build, and verify-results (#18) c010cf8 Fix bash 3.2 compatibility (#23) abeb9d3 Remove .source file support from pg_regress integration (#22) 08c1879 Stamp 1.1.2 6e0dad2 Fix double --dbname bug that defeated unique test database names 639756c Stamp 1.1.1 6ba3176 Fix pg_tle exception handler and empty upgrade files (#15) 3b8cb2a Stamp 1.1.0 550a901 Remove commit.md (maintained in pgxntool-test) d73ca93 Add unique test database names to prevent conflicts (#13) 9b344be Add update-setup-files.sh for 3-way merging after pgxntool-sync (#12) ab7f6e2 Stamp 1.0.0 3a571ba Add pg_tle support and modernize test infrastructure (#11) b96ea6d Add support for Claude code; build and doc improvements (#9) e9c24de Fix pg_regress on versions > 12 (#5) c0af00f Improvements to HISTORY.asc 6e8f2a7 Allow use of sudo when installing an extension 705f1ec Don't run clean as part of make test 370fa8e Create test/sql during setup 890053c Fix bug with DOCS 5c2173e Fix DOCS variable d8bf8ed Update HISTOROY f92d493 Add support for asciidoc dbdd978 Improve asciidoc handling 90bbfa5 Merge branch 'stable' 2f11ef0 Support 9.2 bceb84d Don't over-write DOC 1b97c8c Add pgtap as an installcheck dependency cd24b0f Reduce verbosity of test setup 48dce67 Install tap before runing deps.sql 6cb4302 Add input files as deps to installcheck c0e70ca Merge branch 'release' 899233d Merge branch 'master' into stable e8dff79 Update HISTORY f49e6e3 Fix version number handling ed515aa Remove errant . 8856f1e Decimal point doesn't work, just multiply MAJORVER by 10 35d13b3 Switch to leaving decimal point in MAJORVER 8c59619 Merge branch 'master' into stable 17ee75a Fix typo 5c3032f Add EXTENSION_SQL_FILES variable dcac898 Document the test targets e4884c2 Merge branch 'master' into stable c05f446 Clarify current version d2e6c79 Update HISTORY c3c1a08 Switch variable name for versioning aa93684 Merge branch 'release' 940f35b Merge branch 'master' into stable e6205f8 Remove merge conflict 1f5fcc5 Update HISTOROY 8b8e9b5 Remove invalid options from git subtree pull 2c1e313 Merge branch 'release' 227f558 Merge branch 'release' into stable e5f78b3 Update history e711eef Need to install upgrade scripts 102a856 Favor upstream changes in case of conflict eda5f38 Merge branch 'release' 18532a9 Consistent spelling of license 7d3f6ad History for 0.1.8 3264d28 Silence meta output a4ea40b Add expected/ as a dep 732f534 Handle alpha and beta versions 82216b6 Fix test directory handling 14e4ebc Distribution names can't contain spaces either 4aff20a Ignore meta.mk 04713aa Refactor; add PGXN/PGXNVERSION variables 02ae242 Move key to a safe location cbe8921 Change names to support new tools 3765700 Switch to generating a meta.mk file for Make dependencies on META.json 2e78459 Merge branch 'master' of github.com:decibel/pgxntool 2b8e24a History for release aac4331 Ignore ALL .asc files 2b46bda Merge pull request #3 from pnorman/patch-1 866bbe5 Use bash for setup.sh 97aaf7f Fix .gitattributes c8c4727 Merge branch 'stable' 4a57b43 Pull pgxntool from ../pgxntool stable b877657 Add note about what pgxntool is 13b0265 Test ignoring PGXNtool README b94e2f4 If output dir is needed but doesn't exist, create it. d173527 Fix directory name adc4348 Add test/sql as dep. Clean up directory creation. 0af7768 Create test output stuff if missing 798b6f4 Merge branch 'master' into stable cf42f7b Add git status output 3746eea Fix shell bug 616741a Ensure repo is empty c35e846 Add setup.sh to install instructions cf6fb04 Add make help 3b23055 Merge branch 'release' 905922e Merge branch 'master' into stable 93ff527 Leave pgTap being loaded by setup.sql c36180f Squashed commit of the following: 1dfff38 Improve warning f6464b9 Add option to sync stable 749ff01 Add test/..../finish.sql d71400c Merge branch 'release' 15d2567 Pull pgxntool from ../pgxntool master 732514e Fix $(DATA) 0c84d43 Improve print- recipe 6f7701e Merge branch 'master' into stable 5942cc9 Fix tap schema a8fa40e Move deps to a file c9a0b40 Add pgTap to deps a0ab465 Fix REGRESS rules 882447c Fix test file detection d152f6e Merge branch 'master' of github.com:decibel/pgxntool a7a7dfe Formatting 393f301 Unset MODULES if it's empty 84fa612 Always attempt to build source files 9922a17 Adjust META.in.json so it's valid 411dfaf .source inputs need to be in an input directory 03b542a Fix .source test file support cef41f7 Support .source test files 3a08445 Make testing more extensible Add TESTDIR and TESTOUT variables Explicitly tell pg_regress where to put output acc8c17 Minor tweak to refer to new features. ea3c67f Merge branch 'release' dce257a Merge branch 'test' 0596bdd Merge stable: Fix for pgtap, keep public in search path 5e6305e Merge branch 'master' into stable 4473ed5 Fix problem with pgtap dependencies. d043f2a Keep public in the search path for TAP c38a392 Merge branch 'master' into stable c6a31f0 Merge branch 'test' into stable ac48ccf Merge branch 'release' 6a10733 Merge back from release 8d9f9b6 Fix README.asc after merge aa3ea7f Merge branch 'test' b0bf5b1 0.1.2: Add a bunch of features 4fb946f Don't export README c17abbe Suggest initial setup is a squash commit. f99608e Ready to test 0.1.2 e895a08 Have setup add META.json to git 1629702 Fix off-by-1 in tail f133686 Deps issues ea3e515 Fix META.json build issues ecd0291 Make META.json variables recursive 5feee21 Copy META.in.json over. 979d836 Merge branch 'test' 77cd2da Support empty doc directory. Other improvements 1b32e06 Improve setup commit message 1ab4aa3 Add misssing file f3f28d2 First stab at build_meta.sh 963b040 Missing comma b984240 Don't puke if test/pgxntool already exists 5ade3be Fix file tests 9e97951 Better error handling; safecp() be55d12 Make sure we're not accidentally ignoring META.json 48df320 Add template META.in.json 5f0dcd9 Update final message 992dca3 Add git stuff c7bae04 Move .gitignore to a file c05317b Add target to list all targets da11d03 Add test helpers 1d1935f Add .gitignore 4632361 Fix typo 5ec6aa4 Add license and README d27b1e2 Add dist-only rule 57c52fa Fix variable reference bc0c837 Fix file path problem e4bafbb Add sync commands 5069d9c Add JSON.sh 2ade7d9 Numerous changes to support test_factory c556c41 Add .gitignore b7a9cac Add initial makefiles from test_factory git-subtree-dir: pgxntool git-subtree-split: a6d3287e879c45aa0c9a32c6f9513312396c8915
…release # Conflicts: # pgxntool/CLAUDE.md # pgxntool/HISTORY.asc # pgxntool/README.asc # pgxntool/README.html # pgxntool/base.mk
pgxntool 2.3.0's base.mk widens the DATA wildcard to sql/*--*.sql (was sql/*--*--*.sql), natively picking up single-version install scripts like sql/count_nulls--1.0.0.sql instead of requiring each one to be listed by hand. Verified: make install still ships count_nulls--0.9.6.sql and count_nulls--1.0.0.sql; make test/verify-results pass against PG17. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…suite Per pgxntool/README.asc's test/install and Update & Upgrade (U&U) Testing sections: count_nulls is now installed once, committed, by test/install/load.sql before the main test/sql/ schedule runs, instead of each test file doing its own CREATE EXTENSION via test/deps.sql. This is phase 1 of several - fresh-only, no schema targeting yet (that's a follow-up) - laying the foundation update/upgrade testing needs: test/install runs in its own committed session, so a later ALTER EXTENSION UPDATE there can actually commit, unlike inside test/deps.sql's per-test rolled-back transaction. Retires the old ad hoc pattern where each test file hardcoded its own literal schema name (\set schema ...) as a stand-in for real schema-qualification coverage. test/sql/simple.sql is now a strict subset of extension_tests.sql (same assertions, same install) and test/sql/sanity.sql's own bare CREATE EXTENSION would now conflict with test/install's already-committed install - both removed; their behavioral coverage was already redundant with test__functionality. Side effect worth noting: since test/install runs in its own bare connection (not the in-suite session tap_setup.sql runs in), the extension now lands in 'public' rather than pgTap's own schema - this is the ONLY landing location for an untargeted install now, which incidentally eliminates a source of expected-output divergence between entry points that a schema-targeting phase would otherwise have needed to handle separately. Verified: make test / make verify-results pass against PG17. 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 |
# Conflicts: # Makefile
…stall/load.sql Convert each file's opening multi-line -- comment block to a single /* */ block comment per .vendor/linter's comment-stacked-dashes rule (3+ consecutive -- lines must use block comment syntax). Also reworded two lines that referenced the "test/sql/*.sql" glob pattern literally: PostgreSQL supports real nested /* */ comments, and the linter matches that semantics, so the literal "/*" substring inside "sql/*.sql" was being parsed as a nested block-comment open - leaving the block comment unterminated from the parser's perspective and misflagging the following CREATE EXTENSION line. Reworded to "under test/sql/" to avoid the substring entirely.
|
Claude finished @jnasbyupgrade's task in 2m 57s —— View job Claude finished reviewing PR #27
SummaryThis is a clean, well-scoped adoption of pgxntool's
Minor, non-blocking observation
No other issues found — the changes are minimal, correctly scoped to "fresh install only, no schema targeting yet" as stated, and internally consistent with the follow-up phases described in the PR body. |
The explanatory comment describing why count_nulls installation moved to test/install/load.sql served its purpose during that transition but is no longer needed - the file's role (a no-op placeholder for future per-test dependencies) is self-evident from it being empty and \i'd from test/pgxntool/setup.sql.
|
Claude finished @jnasbyupgrade's task in 2m 55s —— View job Reviewing PR #27
SummaryThis is a clean, well-scoped adoption of pgxntool's Finding
/*
* count_nulls is installed by test/install/load.sql with no schema
* targeting - it lands wherever the session's own search_path resolves at
* CREATE EXTENSION time (in-suite, that's pgTap's own schema, put on
* search_path first by test/pgxntool/tap_setup.sql). ...
*/This says Other things checked, no issues found
|
Add startup__capture_search_path/teardown__search_path_unchanged to _null_count_test so a plain exception fires if any test in this suite mutates search_path and fails to restore it, per maintainer feedback on PR #27. The baseline is captured once into a TEMP TABLE (outside the per-test rollback) so teardown can compare against it after every test.
|
Claude finished @jnasbyupgrade's task in 6m 4s —— View job Reviewing PR #27
SummarySince the last review pass ( Design of the new guard looks sound. Previously-flagged issue: still openA prior review pass on this PR flagged /*
* count_nulls is installed by test/install/load.sql with no schema
* targeting - it lands wherever the session's own search_path resolves at
* CREATE EXTENSION time (in-suite, that's pgTap's own schema, put on
* search_path first by test/pgxntool/tap_setup.sql). ...
*/This still contradicts the PR's own "Notable side effect" explanation: Other things checked, no new issues found
|
…iteral
The expected search_path at this phase is already known statically from
the SET SEARCH_PATH two lines above (no TEST_SCHEMA concept exists yet),
so there's nothing to capture at runtime. Drop
startup__capture_search_path and its TEMP TABLE entirely; teardown__
compares current_setting('search_path') directly against the hardcoded
literal, per maintainer feedback on PR #27.
|
Claude finished @jnasbyupgrade's task in 2m 12s —— View job Reviewing PR #27
SummarySince the last review pass, three commits were added:
Previously-flagged issue: still openA prior review pass flagged /*
* count_nulls is installed by test/install/load.sql with no schema
* targeting - it lands wherever the session's own search_path resolves at
* CREATE EXTENSION time (in-suite, that's pgTap's own schema, put on
* search_path first by test/pgxntool/tap_setup.sql). ...
*/This contradicts the PR's own "Notable side effect" section: Other things checked, no new issues found
|
Document why these two search_path checks aren't redundant: this one doesn't know where count_nulls actually landed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Claude finished @jnasbyupgrade's task in 59s —— View job Reviewing PR #27
SummarySince the last review pass, one new commit was pushed: Previously-flagged issue: still open, and now cross-referencedThree prior review passes flagged the comment above /*
* count_nulls is installed by test/install/load.sql with no schema
* targeting - it lands wherever the session's own search_path resolves at
* CREATE EXTENSION time (in-suite, that's pgTap's own schema, put on
* search_path first by test/pgxntool/tap_setup.sql). ...
*/This still contradicts the PR's own "Notable side effect" explanation: This is now slightly more consequential than before: Other things checked, no new issues found
|
…raph The prior cross-reference was folded into the end of an existing sentence, easy to miss when skimming the block; call it out as its own labeled paragraph instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Claude finished @jnasbyupgrade's task in 1m 3s —— View job Reviewing PR #27
SummarySince the last review pass, one new commit was pushed: * SEE ALSO: test__check_ncs in test/sql/extension_tests.sql, which checks
* WHERE count_nulls actually landed (a different risk than this check).This is accurate and a reasonable readability improvement — no logic changed, purely a comment reflow. Previously-flagged issue: still openFour prior review passes have flagged the comment above /*
* count_nulls is installed by test/install/load.sql with no schema
* targeting - it lands wherever the session's own search_path resolves at
* CREATE EXTENSION time (in-suite, that's pgTap's own schema, put on
* search_path first by test/pgxntool/tap_setup.sql). ...
*/This still contradicts the PR's own "Notable side effect" explanation: Other things checked, no new issues found
|
test__check_ncs already got a one-way SEE ALSO pointer from the other side; add the reciprocal note here so the relationship reads both ways even at this early, pre-TEST_SCHEMA point in the stack. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test/install's adoption made the old per-test install role obsolete, but pgxntool/test/pgxntool/setup.sql unconditionally \i's this file, and pgxntool's subtree-sync reconciliation tracks it alongside .gitignore - so it stays, ready for a genuine future per-test dependency need. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Claude finished @jnasbyupgrade's task in 1m 37s —— View job Reviewing PR #27
SummarySince the last review pass (
Previously-flagged issue: still openFive prior review passes have flagged the comment above /*
* count_nulls is installed by test/install/load.sql with no schema
* targeting - it lands wherever the session's own search_path resolves at
* CREATE EXTENSION time (in-suite, that's pgTap's own schema, put on
* search_path first by test/pgxntool/tap_setup.sql). ...
*/I re-verified this against the current tree: This keeps getting more consequential rather than less: there are now two separate cross-references converging on this comment — Other things checked, no new issues found
|
Stacked on #25 (pgxntool 2.3.0 bump). First of several phases adding update+upgrade (U&U) test coverage - see pgxntool/README.asc's `test/install` and "Update & Upgrade (U&U) Testing" sections, which this follows directly (and which, worth noting, cites this repo's own prior `test/sql/extension_tests.sql` at an old commit as a schema-targeting example, with an explicit caveat against copying its plpgsql-function-based assertion style - a caveat this redesign takes seriously).
What changed
Fresh-only, no schema targeting yet - deliberately scoped small. Schema-switching and update/upgrade mode selection are follow-up phases, stacked on this one.
Notable side effect
Since `test/install` runs in its own bare connection (not the in-suite session pgTAP's own `tap_setup.sql` runs in, which normally puts pgTAP's schema on `search_path` first), an untargeted `CREATE EXTENSION` now lands in `public` instead of pgTAP's own schema. This is actually a simplification: it's now the only possible landing location for "no schema specified," which incidentally forecloses a source of expected-output divergence between entry points (in-suite vs. an external bare-psql install) that a schema-targeting phase would otherwise have had to handle as a separate case.
Verification
`make test` / `make verify-results` pass against this container's live PG17 (2/2: `../install/load`, `extension_tests`).