Skip to content

Add TEST_SCHEMA: install location as a whole-suite test dimension - #36

Open
jnasbyupgrade wants to merge 1 commit into
test-install-foundationfrom
test-schema-dimension
Open

Add TEST_SCHEMA: install location as a whole-suite test dimension#36
jnasbyupgrade wants to merge 1 commit into
test-install-foundationfrom
test-schema-dimension

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Summary

  • extension_drop's control file has no schema= line, so it's genuinely install-schema-flexible — nothing in its own SQL may assume where it landed.
  • test/sql/schema.sql already proves the stricter off-search_path/quoting property on its own, but only for whatever it happens to exercise. This adds a TEST_SCHEMA switch (mirroring TEST_LOAD_SOURCE's existing GUC-propagation mechanism) so the whole suite runs against an explicitly-chosen schema too, catching schema-hardcoding bugs elsewhere that a single dedicated test wouldn't necessarily reach. Complements, not replaces, schema.sql.
  • test/install/load.sql targets TEST_SCHEMA with CREATE EXTENSION ... SCHEMA, never by mutating search_path first (which would mask exactly the bug this exists to catch).
  • test/deps.sql adds the target schema to search_path for convenience, so the rest of the suite's unqualified calls to extension_drop's own functions keep working unchanged.
  • Not a CI matrix dimension — a schema name is an input value the same assertions run against in the same environment, not a real isolation boundary. make test-schema-all runs both legs (empty, and a quoting-required name that's both mixed-case AND contains a space) locally.

Reference implementation: Postgres-Extensions/pg_count_nulls#28.

Test plan

  • make test (default, empty TEST_SCHEMA) passes
  • make test TEST_SCHEMA="Test Schema" passes, and verified directly against pg_extension/pg_namespace that extension_drop actually landed in "Test Schema"
  • make test-schema-all (both legs) passes
  • make lint clean
  • Confirmed make test-update TEST_UPDATE_FROM=0.1.1 fails identically with and without this change (pre-existing, documented limitation — no real second released version yet)

extension_drop's control file has no schema= line, so it's genuinely
install-schema-flexible -- nothing in its own SQL may assume where
it landed. test/sql/schema.sql already proves the stricter
off-search_path/quoting property on its own, but only for whatever
it happens to exercise; this runs the WHOLE suite (not just that one
file) against an explicitly-chosen schema too, catching
schema-hardcoding bugs elsewhere that a single dedicated test
wouldn't necessarily reach.

TEST_SCHEMA propagates via PGOPTIONS to test/install/load.sql (which
targets it with CREATE EXTENSION ... SCHEMA, never by mutating
search_path first) and test/deps.sql (which adds it to search_path
for convenience, so the rest of the suite's unqualified calls to
extension_drop's own functions keep working unchanged). Not a CI
matrix dimension -- a schema name is an input value the same
assertions run against in the same environment, not a real isolation
boundary; `make test-schema-all` runs both the empty and the
quoting-required (mixed-case AND space) legs locally instead.

Reference implementation: Postgres-Extensions/pg_count_nulls#28.
@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: dad5167f-04fb-4f17-965b-622da8d91c04

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.

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