TEST_SCHEMA switching in test/install + schema-invariant assertions - #28
TEST_SCHEMA switching in test/install + schema-invariant assertions#28jnasbyupgrade wants to merge 2 commits into
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 |
Code reviewFound 2 high-signal issues: 1. CLAUDE.md violation —
|
…ertions
test/install/load.sql now reads the count_nulls.test_schema GUC (set via
the Makefile's TEST_SCHEMA var, same PGOPTIONS-propagation mechanism as
before) to decide whether to CREATE SCHEMA/SET search_path before
installing - empty means no targeting at all, non-empty explicitly targets
that schema, matching TEST_SCHEMA=Quoted locally.
The harder part: test/core/functions.sql's pgTAP assertions build the SQL
they execute via %I-qualification through ncs() (always correct regardless
of where count_nulls actually landed), but now pass an EXPLICIT, schema-free
description to every call, overriding pgTAP's own auto-generated
descriptions (which embed the schema). This keeps
test/expected/extension_tests.out a single file both the empty and Quoted
TEST_SCHEMA legs pass against, instead of needing one file per schema
value - confirmed by diffing a real Quoted run against the empty-schema
baseline: identical except one line.
That one line is a genuine, unavoidable exception, not an artifact:
test__shutdown__drop_all drops the schema TEST_SCHEMA created, which is
real, different, correct behavior between "there's a schema to clean up"
and "there isn't" (nothing to drop when TEST_SCHEMA is empty). Handled via
pg_regress's native numbered-alternate mechanism -
test/expected/extension_tests_1.out, captured from a real
TEST_SCHEMA=Quoted run - documented in test/README.md's scenario writeup.
Crossed the `test` CI job with TEST_SCHEMA={"", Quoted}.
Verified: make verify-results passes for both the default and
TEST_SCHEMA=Quoted legs against PG17.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Per a review pass against Postgres-Extensions/cat_tools' own experience (test-fixes.md item 6, found while syncing that repo to pgxntool 2.3.0): a schema name is just an input value the SAME assertions run against in the SAME environment, not a real isolation/environment boundary (unlike PostgreSQL major - different binaries, different container - or pg_tle deployment, which must never share a runner with a filesystem install). Crossing it into the CI matrix only multiplies job count for zero added confidence per dollar. Added test-schema-all: loops TEST_SCHEMA through every value via sequential recursive $(MAKE) calls (same pattern test-update already uses for the load-mode axis), exit 1 on the first failure so a later iteration can't mask an earlier one, each iteration echoed so a failure's TEST_SCHEMA value is still directly attributable without a separate CI check name per value. The `test` CI job now calls this once per PostgreSQL major instead of crossing pg x schema - job count for this job drops back to one per PG major. Verified locally against PG17: both TEST_SCHEMA values pass via `make test-schema-all`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
f419b19 to
0c330ae
Compare
Stacked on #27 (phase 1: test/install adoption). Adds the schema-targeting axis that #27 deliberately deferred.
What changed
Why this matters for what's next
This is the piece that makes crossing update/upgrade testing WITH schema scenarios (a later phase) free - no additional expected-output files needed there either, since the invariance holds regardless of how count_nulls got installed, not just for a fresh install.
Verification
`make verify-results` passes for both the default and `TEST_SCHEMA=Quoted` legs against this container's live PG17.