Skip to content

Adopt test/install, decoupling installation from the test suite - #27

Open
jnasbyupgrade wants to merge 14 commits into
masterfrom
phase1-test-install
Open

Adopt test/install, decoupling installation from the test suite#27
jnasbyupgrade wants to merge 14 commits into
masterfrom
phase1-test-install

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

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

  • `test/install/load.sql`: installs count_nulls once, committed, before the main `test/sql/` schedule - replacing each test file's own per-test `CREATE EXTENSION` via `test/deps.sql`. Its own output isn't tracked (see `test/install/.gitignore`) - pg_regress resolves its expected/actual paths to the same file, so the diff is always self-identical regardless of content; correctness comes from the SQL itself failing loudly, not a textual comparison (matching cat_tools' own `test/install/load.sql`).
  • Retired the old ad hoc pattern where each test file hardcoded its own literal schema name (`\set schema ...`) as a stand-in for schema-qualification coverage. `test/sql/simple.sql` (same assertions as `extension_tests.sql`, just a different hardcoded schema) is now a strict subset once there's one canonical install location - removed. `test/sql/sanity.sql`'s own bare `CREATE EXTENSION` would now conflict with test/install's already-committed install anyway, and its coverage was already a subset of `test__functionality` - removed too.
  • `test/core/functions.sql`/`test/sql/extension_tests.sql`: dropped the now-undefined `:schema` psql variable references; simplified `test__check_ncs`/`test__shutdown__drop_all` to not assume a specific hardcoded target (a future schema-targeting phase will make these real assertions again).

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`).

jnasbyupgrade and others added 5 commits July 31, 2026 18:19
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>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53a9c8f3-b486-4814-b911-7fcd367e79d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jnasbyupgrade jnasbyupgrade changed the title Phase 1: adopt test/install, decoupling installation from the test suite Adopt test/install, decoupling installation from the test suite Aug 4, 2026
@jnasbyupgrade
jnasbyupgrade changed the base branch from phase0-pgxntool-2.3.0 to master August 4, 2026 20:27
…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.
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 2m 57s —— View job


Claude finished reviewing PR #27

  • Gather context (repo CLAUDE.md, diff, changed files)
  • Verify the mechanism claims in the PR description against the actual pgxntool vendor code
  • Review each changed file for correctness
  • Post review feedback

Summary

This is a clean, well-scoped adoption of pgxntool's test/install feature. I traced the actual mechanics through the vendored pgxntool/base.mk and pgxntool/README.asc to verify the PR's claims, and everything checks out:

  • test/install/load.sql installs count_nulls once via a schedule pg_regress processes before test/sql/*, in the same invocation so the committed state persists (pgxntool/base.mk:280-301). The "self-diffing" trick — --inputdir/--outputdir both resolve to test, and the schedule's ../install/load relative path makes expected and actual paths collapse to the identical file test/install/load.out — is real and matches the documented mechanism, not just an assertion in the PR body.
  • The schema-landing side effect is correct: test/pgxntool/tap_setup.sql:11 sets search_path = tap, public only within the in-suite connection; test/install's separate bare connection never sources that file, so its CREATE EXTENSION count_nulls (search_path defaulting to public) is exactly why test/expected/extension_tests.out now shows public.null_count(...) instead of schema_to_load_count_nulls.null_count(...).
  • Removed test/sql/sanity.sql / simple.sql: confirmed sanity.sql's bare CREATE EXTENSION count_nulls would now fail (already installed by test/install), and its coverage (null_count over jsonb/nulls) is a subset of test__functionality in test/core/functions.sql:144-187. simple.sql was already a strict subset of extension_tests.sql's runtests() call. No orphaned :schema references remain anywhere in test/ after the cleanup.
  • Makefile: PGXNTOOL_ENABLE_TEST_INSTALL = yes is a real, documented variable in this vendored pgxntool version (base.mk:132-138), and setting it explicitly (rather than relying on auto-detect) matches the stated intent — fail loudly if test/install/ ever ends up empty by accident.
  • test/expected/extension_tests.out diff is fully consistent with the .sql changes (schema name substitutions, dropped assertions for the removed DROP SCHEMA step, test__check_ncs reduced to isnt(ncs(), NULL, ...)).
  • CI is green (CI run passed).

Minor, non-blocking observation

test/install/.gitignore ignores load.out and install.out.diff. load.out is correct (it's the self-diffing artifact described above). install.out.diff doesn't correspond to anything actually produced by this vendored pgxntool — there's no per-test .out.diff generation in base.mk or its scripts (only a single aggregate regression.diffs), and even if such a file were ever produced for this test, the install file is named load.sql, so the artifact would presumably be load.out.diff, not install.out.diff. Likely copied from a generic template/example. Harmless either way since this test's diff is definitionally always empty, but worth double-checking against the cat_tools example this was modeled on.

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.
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 2m 55s —— View job


Reviewing PR #27

  • Gather context (CLAUDE.md, diff, changed files)
  • Run code review
  • Post findings

Summary

This is a clean, well-scoped adoption of pgxntool's test/install feature, matching the documented mechanism in pgxntool/base.mk/README.asc (confirmed by reading base.mk:125-164,280-301 directly). Since the last review pass, test/deps.sql was emptied out entirely — I checked pgxntool/README.asc:191 and it explicitly says this is the correct move once test/install is adopted ("test/deps.sql should no longer run CREATE EXTENSION itself... the committed install performed by test/install persists into every ... test file"), so that final commit is correct, not a leftover. make test's CI run for the current HEAD (5f0af6e) is green.

Finding

test/sql/extension_tests.sql:7-15 — comment misdescribes where count_nulls actually lands, contradicting the PR's own explanation and the expected output.

/*
 * 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 count_nulls is installed by test/install/load.sql, then in the same breath describes the landing schema as "in-suite, that's pgTap's own schema" — but test/install/load.sql runs in its own bare connection, not in-suite (as the PR body's own "Notable side effect" section correctly explains, and as test/pgxntool/tap_setup.sql:12's SET search_path = tap, public only ever applies to the in-suite connection that never sources it). The actual CREATE EXTENSION in test/install/load.sql runs with the default search_path of that bare connection, which is why test/expected/extension_tests.out shows public.null_count(...), not tap.null_count(...). The parenthetical describes what would happen if the extension were installed in-suite, which isn't what happens here — a future reader could easily conclude ncs() will resolve to tap, then be confused when it's public. Worth tightening to match the PR body's own (correct) explanation.

Fix this →

Other things checked, no issues found

  • No orphaned :schema psql-variable references remain anywhere under test/ after the cleanup.
  • test/sql/sanity.sql/simple.sql removal is safe: sanity.sql's bare CREATE EXTENSION count_nulls would now conflict with the already-committed install; its and simple.sql's coverage is a strict subset of test__functionality/extension_tests.sql.
  • Makefile's PGXNTOOL_ENABLE_TEST_INSTALL = yes is a real, documented variable (base.mk:132-138) and fails loudly (rather than silently falling back) if test/install/ is ever emptied by accident — matches stated intent.
  • test/expected/extension_tests.out diff is fully consistent with the .sql changes (schema substitutions, dropped DROP SCHEMA assertion, test__check_ncs reduced to isnt(ncs(), NULL, ...)).
  • The minor test/install/.gitignore's install.out.diff entry (doesn't correspond to any file this vendored pgxntool actually produces — the real self-diffing artifact is load.out) noted in the prior review pass is still present; harmless since the diff is definitionally always empty either way, but still worth a quick check against the cat_tools example this was modeled on.

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.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 6m 4s —— View job


Reviewing PR #27

  • Gather context (CLAUDE.md, diff, changed files)
  • Check whether previously-flagged issue was addressed
  • Review new commit (b9e1d33) for correctness
  • Post findings

Summary

Since the last review pass (5f0af6e), one new commit was pushed: b9e1d33 — "Guard search_path against cross-test contamination", adding _null_count_test.startup__capture_search_path / _null_count_test.teardown__search_path_unchanged to test/core/functions.sql. No CLAUDE.md exists in this repo to check against. CI (31033179792) is green for the current HEAD.

Design of the new guard looks sound. startup__capture_search_path runs once, before any per-test SAVEPOINT/ROLLBACK machinery, so the TEMP TABLE search_path_baseline it creates survives across each test's rollback; teardown__search_path_unchanged then compares against it after every test and raises a plain exception on drift. Walking through the current test file, none of test__check_ncs/test__definition/test__functionality/test__shutdown__drop_all issue a session-level SET search_path, so there's no false-positive trip expected today — this is purely a regression guard for future tests, as intended. Neither hook produces TAP output on success (no RETURN NEXT), which is why test/expected/extension_tests.out didn't need to change for this commit.

Previously-flagged issue: still open

A prior review pass on this PR flagged test/sql/extension_tests.sql lines 7-15, and this commit did not touch that file (only test/core/functions.sql), so the issue remains. The comment there still reads:

/*
 * 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: test/install/load.sql runs in its own bare connection that never sources test/pgxntool/tap_setup.sql, so count_nulls actually lands in public (matching test/expected/extension_tests.out's public.null_count(...)), not in pgTAP's schema. Worth tightening before merge so a future reader isn't misled into expecting ncs() to resolve to tap.

Fix this →

Other things checked, no new issues found

  • test/install/.gitignore's install.out.diff entry (doesn't correspond to any file this vendored pgxntool actually produces) is still present from prior reviews — harmless, non-blocking.
  • No orphaned :schema psql-variable references anywhere under test/.
  • No other logic issues found in the new startup__/teardown__ guard functions.

…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.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 2m 12s —— View job


Reviewing PR #27

  • Gather context (diff vs origin/master, changed files)
  • Check whether previously-flagged issue was addressed
  • Review new commits (5f0af6e, b9e1d33, dac37ca) for correctness
  • Check CI status
  • Post findings

Summary

Since the last review pass, three commits were added: 5f0af6e (empty out test/deps.sql entirely), b9e1d33 (add a search_path cross-test-contamination guard), and dac37ca (simplify that guard to compare against a static literal instead of a captured TEMP TABLE). CI for the current HEAD is green.

  • test/deps.sql emptied out: confirmed against pgxntool/README.asc:191, which explicitly says test/deps.sql should no longer run CREATE EXTENSION once test/install is adopted, since the committed install persists into every test file. Correct, not a leftover.
  • test/core/functions.sql:37-49teardown__search_path_unchanged: sound as simplified. It compares current_setting('search_path') against the static literal '_null_count_test, tap' (the same value set two lines above SET SEARCH_PATH = _null_count_test, tap; at line 4), and raises a plain exception on drift — appropriate since pgTAP's runner reports an exception from a teardown__ function as "Test died: ..." against the test that ran before it, no ok()/is() needed. Dropping the earlier TEMP TABLE-based capture (from b9e1d33) in favor of a hardcoded literal is a reasonable simplification given there's no TEST_SCHEMA concept yet in this phase — nothing to capture at runtime that isn't already known statically. Walking through the current test file, none of test__check_ncs/test__definition/test__functionality/test__shutdown__drop_all issue a session-level SET search_path, so no false-positive trip is expected today; this is a forward-looking regression guard. Neither hook produces TAP output on success, consistent with test/expected/extension_tests.out not needing changes for this addition.

Previously-flagged issue: still open

A prior review pass flagged test/sql/extension_tests.sql lines 7-15, and none of the three new commits touch that file, so it's unresolved. The comment above test__check_ncs still reads:

/*
 * 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: test/install/load.sql runs CREATE EXTENSION in its own bare connection, which never sources test/pgxntool/tap_setup.sql's search_path change — so count_nulls actually lands in public (matching test/expected/extension_tests.out's public.null_count(...), public.not_null_count_trigger(...), etc.), not in pgTAP's schema. A future reader could reasonably expect ncs() to resolve to tap based on this comment, then be confused when it resolves to public. Worth tightening before merge to match the PR body's own correct explanation.

Fix this →

Other things checked, no new issues found

  • test/install/.gitignore's install.out.diff entry (doesn't correspond to any file this vendored pgxntool actually produces — the real self-diffing artifact is load.out) is still present from prior reviews; harmless, non-blocking.
  • Makefile's PGXNTOOL_ENABLE_TEST_INSTALL = yes and test/install/load.sql are unchanged from prior passes and still match pgxntool/base.mk's documented mechanism.
  • No orphaned :schema psql-variable references anywhere under test/.
  • test/expected/extension_tests.out is internally consistent with the current .sql files; no drift.

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>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 59s —— View job


Reviewing PR #27

  • Gather context (diff vs origin/master, changed files)
  • Check whether previously-flagged issue was addressed
  • Review new commit (afe204f) for correctness
  • Post findings

Summary

Since the last review pass, one new commit was pushed: afe204f — "Cross-reference teardown__search_path_unchanged with test__check_ncs", touching only test/core/functions.sql:35-36. It adds a clarifying sentence to the comment above teardown__search_path_unchanged: "Doesn't check WHERE count_nulls actually landed - see test__check_ncs in test/sql/extension_tests.sql for that." This is accurate and a good addition on its own — it correctly scopes what the new guard does and doesn't cover, and points readers at the right companion check.

Previously-flagged issue: still open, and now cross-referenced

Three prior review passes flagged the comment above test__check_ncs in test/sql/extension_tests.sql:7-15. afe204f doesn't touch that file, so it's still unresolved:

/*
 * 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: test/install/load.sql runs CREATE EXTENSION in its own bare connection, which never sources test/pgxntool/tap_setup.sql's search_path change — so count_nulls actually lands in public (matching test/expected/extension_tests.out's public.null_count(...)), not in pgTAP's schema.

This is now slightly more consequential than before: afe204f adds a direct cross-reference from teardown__search_path_unchanged pointing readers at this comment as the place to learn "where count_nulls actually landed" — so the incorrect explanation is no longer just locally misleading, it's now the destination of an explicit pointer from another file. Worth tightening before merge so a reader following that cross-reference isn't sent to a comment that gets the mechanism backwards.

Fix this →

Other things checked, no new issues found

  • test/install/.gitignore's install.out.diff entry (doesn't correspond to any file this vendored pgxntool actually produces) is still present from prior reviews — harmless, non-blocking.
  • No orphaned :schema psql-variable references anywhere under test/.
  • test/expected/extension_tests.out still consistent with current .sql files; afe204f's comment-only change requires no expected-output update.
    (branch)

…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>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 1m 3s —— View job


Reviewing PR #27

  • Gather context (diff vs origin/master, changed files, prior review history)
  • Review new commit (6bbe4ce) for correctness
  • Check CI status
  • Post findings

Summary

Since the last review pass, one new commit was pushed: 6bbe4ce — "Make the search_path/test__check_ncs cross-reference a SEE ALSO paragraph", touching only test/core/functions.sql:32-39. It reformats the cross-reference added in afe204f from being folded into the end of a sentence into its own labeled SEE ALSO: paragraph:

 * 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. CI for the current HEAD is green.

Previously-flagged issue: still open

Four prior review passes have flagged the comment above test__check_ncs in test/sql/extension_tests.sql:7-15, and 6bbe4ce doesn't touch that file, so it remains unresolved:

/*
 * 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: test/install/load.sql runs CREATE EXTENSION in its own bare connection, which never sources test/pgxntool/tap_setup.sql's search_path change — so count_nulls actually lands in public (matching test/expected/extension_tests.out's public.null_count(...)), not in pgTAP's schema. The new SEE ALSO paragraph in functions.sql now points readers here even more prominently as "the place to learn where count_nulls actually landed," which makes fixing this text before merge more worthwhile, not less — a reader who follows that cross-reference is sent to an explanation that gets the mechanism backwards.

Fix this →

Other things checked, no new issues found

  • test/install/.gitignore's install.out.diff entry (doesn't correspond to any file this vendored pgxntool actually produces — the real self-diffing artifact is load.out) is still present from prior reviews; harmless, non-blocking.
  • No orphaned :schema psql-variable references anywhere under test/.
  • test/expected/extension_tests.out still consistent with current .sql files; 6bbe4ce's comment-only change requires no expected-output update.
    (branch)

jnasbyupgrade and others added 2 commits August 5, 2026 18:08
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>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Claude finished @jnasbyupgrade's task in 1m 37s —— View job


Reviewing PR #27

  • Gather context (diff vs origin/master, changed files, prior review history)
  • Review new commits since last pass (cae2370, 0d1222b)
  • Check CI status
  • Post findings

Summary

Since the last review pass (6bbe4ce), two new commits were pushed: cae2370 — "Reciprocate the teardown__search_path_unchanged cross-reference" and 0d1222b — "test/deps.sql: explain why it's empty and kept". CI for the current HEAD (0d1222b) is green.

  • cae2370 (test/sql/extension_tests.sql:15-18): adds a reciprocal SEE ALSO paragraph pointing from test__check_ncs's comment back to teardown__search_path_unchanged in test/core/functions.sql, correctly describing it as guarding "a different risk than this check" (drift vs. landing location). Accurate, comment-only, no logic change.
  • 0d1222b (test/deps.sql): replaces the empty file with an explanatory comment. I checked both claims against pgxntool/README.asc directly: the "why it can't be deleted" claim (vendored setup.sql unconditionally does \i test/deps.sql, and it's one of the two files 3-way-merged on git subtree pull) matches README.asc:275 exactly (test/deps.sql is explicitly named as one of the reconciled setup.sh-copied files, alongside .gitignore). Accurate and a genuine improvement over a silently-empty file.

Previously-flagged issue: still open

Five prior review passes have flagged the comment above test__check_ncs in test/sql/extension_tests.sql:7-14, and neither new commit touches that text (the reciprocal SEE ALSO in cae2370 was appended after it, at line 16, leaving the original wording untouched):

/*
 * 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: test/install/load.sql's CREATE EXTENSION count_nulls runs in pg_regress's own bare connection for the ../install/load schedule entry, which never sources test/pgxntool/tap_setup.sql's SET search_path = tap, public (that file is only \i'd from the in-suite tap_setup.sql path used by test/sql/*). Consistent with that, test/expected/extension_tests.out shows public.null_count(anyarray), public.not_null_count(...), etc. throughout — not tap.*. So the comment's parenthetical ("in-suite, that's pgTap's own schema...") still describes a scenario that doesn't match how this extension is actually installed, contradicting the PR's own "Notable side effect" write-up.

This keeps getting more consequential rather than less: there are now two separate cross-references converging on this comment — teardown__search_path_unchanged's SEE ALSO (from afe204f/6bbe4ce) and now cae2370's reciprocal pointer back — both sending readers to a comment whose core claim about where count_nulls lands is backwards.

Fix this →

Other things checked, no new issues found

  • test/install/.gitignore's install.out.diff entry (doesn't correspond to any file this vendored pgxntool actually produces — the real self-diffing artifact is load.out) is still present from prior reviews; harmless, non-blocking.
  • No orphaned :schema psql-variable references anywhere under test/.
  • test/expected/extension_tests.out still consistent with current .sql files; both new commits are comment-only and require no expected-output update.
    (branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant