Test install foundation: TEST_LOAD_SOURCE modes, dependency guard - #19
Conversation
|
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 |
f08db32 to
ef2e29d
Compare
43749f2 to
187577a
Compare
b9a135c to
1efc4de
Compare
3fcef44 to
8f4e50d
Compare
8f4e50d to
67855c7
Compare
dad617f to
5645da3
Compare
692336e to
5a8e081
Compare
5645da3 to
2925fca
Compare
…, quoting-requiring schema test Builds the U&U (update & upgrade) test infrastructure that doesn't require a real second extension_drop version or pg_upgrade CI to already exist: - PGXNTOOL_ENABLE_TEST_INSTALL = yes, with test/install/load.sql as the committed-once installer for the extension (no test roles exist for this extension, so unlike cat_tools there's nothing role-related to add). - TEST_LOAD_SOURCE (fresh/update/existing) GUC/make-var switch, parse-time validated, exported unconditionally, read in load.sql without missing_ok. `existing` mode is fully exercised locally (verified against a real, already-installed database, including the failure path when the extension is genuinely absent). `update` mode is wired up and structurally verified end-to-end, but extension_drop has no real prior released version to update FROM yet -- the Makefile refuses to run it without TEST_UPDATE_FROM set explicitly, and no CI leg exercises it in this repo today. - Dependency guard (test/sql/dependency_guard.sql): a view depending on extension_drop__commands' row type blocks a non-CASCADE DROP EXTENSION; proven by actually attempting the drop and asserting failure, not assumed. - test/sql/schema.sql's custom-schema test names renamed to mixed case (requires identifier quoting), reusing its existing coverage rather than adding a new schema-testing dimension. - ci.yml: run `make test && make verify-results` instead of pg-build-test, so a real regression actually fails the build (pgxntool's .IGNORE: installcheck otherwise reports green regardless of test results, per RELEASE.md's existing note about PRs #6/#7). Moving the extension's own installation into test/install/load.sql required adapting every test file that used to install it per-test in a rolled-back transaction (test/deps.sql, test/sql/simple.sql, test/sql/schema.sql, test/sql/zzz_build.sql) to work against the new committed-once install instead, since an extension name is a database-wide singleton. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…redate this branch CI on this branch showed the switch to `make test && make verify-results` surfacing real pgTAP failures on PostgreSQL 9.3/9.6 (cat_tools/extension_drop never actually install there). Checked PR #10's own baseline CI (#10, run 30665031257): PG 9.3 and 9.6 already report "3 of 3 tests failed" in the raw job log there too, just silently reported as a passing check because pg-build-test's underlying `make test` hits pgxntool's `.IGNORE: installcheck` the same way. So this isn't a regression from this PR's own changes -- it's the exact masking problem RELEASE.md already documents, just now applying to a different, older part of the PG matrix than the PRs (#6/#7) it originally cites. Reverting the ci.yml step back to pg-build-test here keeps this PR scoped to test/install infrastructure; fixing cat_tools's install path on pre-PG10 belongs to whoever owns that dependency setup (PR #10 or a follow-up), not this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two comments described what test/deps.sql or this file's CASCADE logic used to be responsible for, instead of just stating current behavior. That kind of history belongs in commit messages/PR descriptions, not in comments that will rot as the code moves on.
…/deps.sql simple.sql exercises the public/ambient install path, where 'public' is always on search_path -- so its SET search_path line couldn't move the extension's schema off the path and never proved anything; schema.sql already covers that property for the custom-schema path, which is the only path that needs to. The deps.sql comment was fully redundant with test/install/load.sql's own comment about what schema.sql tests.
…mmand Comments describing a branch were placed after the \if/\else/\endif that opens it, reading as if they described the code above instead of below. Move each comment to precede its command, and add the missing one-line rationale to the fresh/update \if pair, which had it on neither side.
2925fca to
03b0355
Compare
|
@claude review |
|
Claude finished @jnasbyupgrade's task in 3m 12s —— View job Claude is reviewing this PR
|
|
Claude finished @jnasbyupgrade's task in 4m 3s —— View job Claude finished reviewing PR #19
· branch ReviewThis PR was already reviewed once in this thread and merged. I independently re-pulled and re-read the actual changed content ( Sequencing / mechanics — same conclusion as before, re-verified:
CLAUDE.md schema-independence check — this repo's
That satisfies both conditions in Makefile
No functional issues found on re-verification. The |

Summary
test/install/load.sql(pgxntool'stest/installfeature): installsextension_dropONCE, committed, before the pgTAP suite runs, instead of every test file reinstalling it viatest/deps.sql.TEST_LOAD_SOURCE(Makefile) selectsfresh(default) /update/existinginstall mode, propagated toload.sqlvia a GUC overPGOPTIONS.test/sql/dependency_guard.sql: proves non-CASCADEDROP EXTENSIONis blocked by the dependency guard.test/deps.sqlsimplified: no longer creates a schema or installs the extension (that'sload.sql's job now).test/sql/simple.sql: removed aSET search_pathline that was dead code once installs moved to the ambient/public path (search_path always includespublic, so it couldn't prove anythingtest/sql/schema.sqldoesn't already cover for the custom-schema path).test/sql/schema.sql: added the minimal preamble (drop the committed install, recreate in its own schema) needed becauseload.sqlnow pre-installs intopublicbefore this file runs.Previously this PR also included a schema-name mixed-case/quoting-robustness rename to
test/sql/schema.sql-- that's unrelated to this PR's actual purpose (the test/install foundation) and has been split out to #34, which this PR is now rebased on top of.Test plan
make testpasses (load, dependency_guard, schema, simple, build)make lintclean