Problem
The entire point of testing with TEST_SCHEMA empty (PR #54) is to prove cat_tools
works correctly when it is NOT on search_path at all — i.e. every reference to a
cat_tools object inside the extension's own SQL is fully schema-qualified, with no
reliance on search_path resolution. But nothing currently stops a test file itself from
quietly setting/mutating search_path (e.g. a stray SET search_path = ... added to
some test/sql/*.sql file for developer convenience while writing a test) — which would
silently defeat that guarantee: the empty-TEST_SCHEMA leg would keep passing even if
cat_tools itself secretly depended on search_path, because the test file quietly put the
right schema on search_path itself rather than cat_tools resolving it correctly on its
own.
What to add
A safeguard — hopefully as simple as a grep — that fails if anything under test/ sets
or otherwise mutates search_path (SET search_path, SET LOCAL search_path,
ALTER ROLE ... SET search_path, ALTER DATABASE ... SET search_path, etc.). Needs to
distinguish legitimate, deliberate search_path manipulation — test/install/load.sql's
own TEST_SCHEMA-targeting SET search_path from PR #54 is supposed to be there —
from anything else that shouldn't be. Where this should live (a make lint-style check,
a dedicated CI step, a pgTAP test) is open; whatever's easiest to grep reliably.
Why this matters now specifically
This wasn't a real risk before PR #54 existed — there was no leg proving "no search_path
at all" was ever actually being exercised. Now that the empty-TEST_SCHEMA leg is meant
to be that proof, a silent violator anywhere under test/ would make that leg pass for
the wrong reason.
Problem
The entire point of testing with
TEST_SCHEMAempty (PR #54) is to prove cat_toolsworks correctly when it is NOT on
search_pathat all — i.e. every reference to acat_tools object inside the extension's own SQL is fully schema-qualified, with no
reliance on search_path resolution. But nothing currently stops a test file itself from
quietly setting/mutating
search_path(e.g. a straySET search_path = ...added tosome
test/sql/*.sqlfile for developer convenience while writing a test) — which wouldsilently defeat that guarantee: the empty-
TEST_SCHEMAleg would keep passing even ifcat_tools itself secretly depended on search_path, because the test file quietly put the
right schema on search_path itself rather than cat_tools resolving it correctly on its
own.
What to add
A safeguard — hopefully as simple as a grep — that fails if anything under
test/setsor otherwise mutates
search_path(SET search_path,SET LOCAL search_path,ALTER ROLE ... SET search_path,ALTER DATABASE ... SET search_path, etc.). Needs todistinguish legitimate, deliberate search_path manipulation —
test/install/load.sql'sown
TEST_SCHEMA-targetingSET search_pathfrom PR #54 is supposed to be there —from anything else that shouldn't be. Where this should live (a
make lint-style check,a dedicated CI step, a pgTAP test) is open; whatever's easiest to grep reliably.
Why this matters now specifically
This wasn't a real risk before PR #54 existed — there was no leg proving "no search_path
at all" was ever actually being exercised. Now that the empty-
TEST_SCHEMAleg is meantto be that proof, a silent violator anywhere under
test/would make that leg pass forthe wrong reason.