Background
In Postgres-Extensions/cat_tools's test/install/load.sql (PR #54), \set ON_ERROR_STOP on
turned out to be load-bearing in a way that's easy to silently break: test/install/*.sql files
run in their own, self-comparing pg_regress entry (see pgxntool's own docs on the test/install
feature), so a RAISE EXCEPTION/hard-error check in one of these files only actually fails the
build if ON_ERROR_STOP is set -- without it, psql prints the error and keeps going, and nothing
ever diffs to catch it. Removing that one \set line silently turns every hard-error check in the
file into a no-op, with no test failure to reveal it.
Proposal (raised for discussion, not a confirmed ask)
Consider whether pgxntool itself should have a build-time check that every test/install/*.sql
file sets ON_ERROR_STOP before anything else that could raise an error -- e.g. a make lint-style
scan, or a check-test-install-error-stop target wired into the existing test/install feature's
own machinery. This would be generic to any pgxntool-based extension using test/install, not
cat_tools-specific.
Open question
Whether this is worth building at all -- an explicit check adds real complexity (parsing/scanning
every install file, deciding what "before anything that could error" means precisely) for a
problem that a code-review comment/convention might catch just as well. Recording the idea here
rather than committing to it; feel free to close as wontfix if the maintainers don't think it's
worth the complexity.
Background
In
Postgres-Extensions/cat_tools'stest/install/load.sql(PR #54),\set ON_ERROR_STOP onturned out to be load-bearing in a way that's easy to silently break:
test/install/*.sqlfilesrun in their own, self-comparing
pg_regressentry (see pgxntool's own docs on thetest/installfeature), so a
RAISE EXCEPTION/hard-error check in one of these files only actually fails thebuild if
ON_ERROR_STOPis set -- without it, psql prints the error and keeps going, and nothingever diffs to catch it. Removing that one
\setline silently turns every hard-error check in thefile into a no-op, with no test failure to reveal it.
Proposal (raised for discussion, not a confirmed ask)
Consider whether pgxntool itself should have a build-time check that every
test/install/*.sqlfile sets
ON_ERROR_STOPbefore anything else that could raise an error -- e.g. amake lint-stylescan, or a
check-test-install-error-stoptarget wired into the existingtest/installfeature'sown machinery. This would be generic to any pgxntool-based extension using
test/install, notcat_tools-specific.
Open question
Whether this is worth building at all -- an explicit check adds real complexity (parsing/scanning
every install file, deciding what "before anything that could error" means precisely) for a
problem that a code-review comment/convention might catch just as well. Recording the idea here
rather than committing to it; feel free to close as wontfix if the maintainers don't think it's
worth the complexity.