Add TEST_SCHEMA: install location as a whole-suite test dimension - #36
Open
jnasbyupgrade wants to merge 1 commit into
Open
Add TEST_SCHEMA: install location as a whole-suite test dimension#36jnasbyupgrade wants to merge 1 commit into
jnasbyupgrade wants to merge 1 commit into
Conversation
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.
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extension_drop's control file has noschema=line, so it's genuinely install-schema-flexible — nothing in its own SQL may assume where it landed.test/sql/schema.sqlalready proves the stricter off-search_path/quoting property on its own, but only for whatever it happens to exercise. This adds aTEST_SCHEMAswitch (mirroringTEST_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.sqltargetsTEST_SCHEMAwithCREATE EXTENSION ... SCHEMA, never by mutatingsearch_pathfirst (which would mask exactly the bug this exists to catch).test/deps.sqladds the target schema tosearch_pathfor convenience, so the rest of the suite's unqualified calls toextension_drop's own functions keep working unchanged.make test-schema-allruns 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, emptyTEST_SCHEMA) passesmake test TEST_SCHEMA="Test Schema"passes, and verified directly againstpg_extension/pg_namespacethatextension_dropactually landed in"Test Schema"make test-schema-all(both legs) passesmake lintcleanmake test-update TEST_UPDATE_FROM=0.1.1fails identically with and without this change (pre-existing, documented limitation — no real second released version yet)