Skip to content

Add CLAUDE.md: document why extension_drop needs schema-independence testing - #35

Merged
jnasbyupgrade merged 2 commits into
masterfrom
add-schema-testing-claude-md
Aug 8, 2026
Merged

Add CLAUDE.md: document why extension_drop needs schema-independence testing#35
jnasbyupgrade merged 2 commits into
masterfrom
add-schema-testing-claude-md

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Summary

  • extension_drop's control file has no schema= line, making it genuinely install-schema-flexible (confirmed against actual PostgreSQL semantics: schema=, not relocatable=, is what pins install-time schema choice).
  • The current test suite only proves qualification-correctness via one dedicated file (test/sql/schema.sql), not across the whole suite.
  • Documents the correct pattern going forward: a TEST_SCHEMA switch mirroring TEST_LOAD_SOURCE's existing GUC-propagation mechanism, per Postgres-Extensions/pg_count_nullsCI: fix claude-code-review by removing the fork-checkout step entirely #28 (a working reference implementation already in the org).

This is documentation only — no test/build changes. Implementing the actual TEST_SCHEMA dimension is tracked as follow-up work.

Test plan

  • N/A (doc-only change)

…testing

extension_drop's control file omits schema=, making it genuinely
install-schema-flexible, but the current test suite only proves this
via one dedicated file (test/sql/schema.sql) rather than across the
whole suite. Record the rationale and the correct pattern (a
TEST_SCHEMA switch mirroring TEST_LOAD_SOURCE, per
Postgres-Extensions/pg_count_nulls#28) so it isn't rediscovered from
scratch, or missed, next time.
@coderabbitai

coderabbitai Bot commented Aug 7, 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: 982b4fb2-08ad-43d4-9908-613e21b55c49

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.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

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


Claude finished reviewing this PR

Todo list:

  • Gather context (PR diff, files changed)
  • Read CLAUDE.md content and surrounding repo context (control files, existing tests)
  • Verify factual claims in the PR body (schema= semantics, existing TEST_SCHEMA/TEST_LOAD_SOURCE mechanism, referenced issue)
  • Provide code review feedback

Review

This is a doc-only addition (CLAUDE.md, +43 lines), and I verified its factual claims against the actual repo state rather than taking them at face value:

  • schema= vs relocatable=: confirmed. extension_drop.control has relocatable = false and no schema = line — matches the doc's claim exactly.
  • Only schema.sql proves the schema-independence property: confirmed. test/sql/schema.sql:52 explicitly removes TEST_SCHEMA_2 from search_path before asserting against it, and uses a mixed-case name (_Test_Ed/_Test_Ed_2) that would break if a reference were left unquoted. test/sql/simple.sql only uses an all-lowercase schema (_test_ed) and never removes it from search_path, so it can't catch either failure mode. The doc's diagnosis of the test suite's current asymmetry is accurate.
  • Existing TEST_SCHEMA mechanism: test/deps.sql:19-20 already reads a per-file \set TEST_SCHEMA variable to CREATE SCHEMA/set search_path, matching the doc's description.

One accuracy nit worth a look before/after merge:

This is best implemented as a TEST_SCHEMA switch on the whole test suite (mirroring TEST_LOAD_SOURCE's existing GUC-propagation mechanism through test/install/load.sql / test/deps.sql)...

Neither test/install/ nor a TEST_LOAD_SOURCE-style Makefile/GUC switch actually exists in this repo — only test/deps.sql's much simpler per-file \set TEST_SCHEMA exists here today. The TEST_LOAD_SOURCE pattern this sentence points to is pgxntool's documented convention, whose real example lives in cat_tools (per pgxntool/README.asc), not in extension_tools. As written, a future implementer skimming this repo's CLAUDE.md could think test/install/load.sql already exists locally to mirror, when in fact building the TEST_SCHEMA switch here means introducing that whole pattern from scratch (there's no test/install directory at all yet). Worth a small tweak to make explicit that this is an external pattern to model, not local infrastructure.

I wasn't able to fetch Postgres-Extensions/pg_count_nulls#28 to confirm its title/content matches "TEST_SCHEMA switching in test/install" — external gh/web access wasn't permitted in this run — so that citation is unverified on my end (not necessarily wrong, just unchecked).

Everything else — the reasoning about search_path-absence and mixed-case/quoting being independently necessary, and marking this as documentation-only with implementation as tracked follow-up — is sound and consistent with the current code. No blocking issues; the one nit above is optional polish.

@jnasbyupgrade
jnasbyupgrade merged commit 33842e4 into master Aug 8, 2026
10 checks passed
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