Repository navigation
Add test coverage for the test/install ON_ERROR_STOP rule #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jnasbyupgrade
merged 6 commits into
Postgres-Extensions:master
from
jnasbyupgrade:fix-error-stop-order-check
Oct 6, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5d43113
Add test coverage for order-sensitive ON_ERROR_STOP check
jnasbyupgrade 6cd3308
Cover psql.sql-plus-turn-off failure in ON_ERROR_STOP check tests
jnasbyupgrade 977c37f
Merge remote-tracking branch 'upstream/master' into fix-error-stop-or…
jnasbyupgrade 4c99c47
Match check-test-install-error-stop tests to the any-mention rule
jnasbyupgrade 8b2ff90
Merge remote-tracking branch 'upstream/master' into fix-error-stop-or…
jnasbyupgrade 38a1fe8
Test that psql.sql actually makes psql stop on error
jnasbyupgrade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header's stated rule contradicts the PR description's stated rule — and the new tests encode the looser one.
This comment says a file passes if it "includes
test/pgxntool/psql.sql" or "has any\set/\unset ON_ERROR_STOPcommand... whatever the value or order." But the PR description says the rule is stricter: a file must explicitly enableON_ERROR_STOP(a later disable is then fine), or includepsql.sqland never disable it — and explicitly lists "psql.sql plus\set ON_ERROR_STOP off: fails", "psql.sql plus\unset ON_ERROR_STOP: fails", and "off only: fails" as cases this PR covers.The four new tests below assert the opposite of those three bullets:
pgxntool-test/test/standard/check-test-install-error-stop-script.bats
Lines 45 to 52 in 8b2ff90
\set ON_ERROR_STOP OFF→ assertsassert_success(PR description: "fails")pgxntool-test/test/standard/check-test-install-error-stop-script.bats
Lines 52 to 59 in 8b2ff90
\ir+\unset ON_ERROR_STOP→ assertsassert_success(PR description: "fails")pgxntool-test/test/standard/check-test-install-error-stop-script.bats
Lines 59 to 66 in 8b2ff90
\set ON_ERROR_STOP 0only, no psql.sql → assertsassert_success(PR description: "off only: fails")pgxntool-test/test/standard/check-test-install-error-stop-script.bats
Lines 66 to 73 in 8b2ff90
\unset ON_ERROR_STOPonly, no psql.sql → same "off only" case, assertsassert_successI traced
handles_error_stop()in the pairedcheck-test-install-error-stop.sh(pgxntool#122): it returns success on any\set/\unset ON_ERROR_STOPline regardless of value, or anypsql.sqlinclude line, with no order/disable tracking at all. So these four assertions are consistent with what the script actually does — but that actual behavior is the opposite of the "never disables it" / "explicitly enables" rule both this PR's description and pgxntool#122's description say is being implemented. As written, atest/install/*.sqlfile that only ever turnsON_ERROR_STOPoff (or includespsql.sqland then disables it) passes this check — even though the check's entire purpose (per the comments a few lines below) is to guarantee a hard SQL error can't be silently swallowed.Worth resolving before merge: either
check-test-install-error-stop.shis missing the disable-tracking logic its own PR description claims, and these four tests should assert failure instead — or the stricter rule described in both PR summaries was never the intended design, and the description/summary text (here and in pgxntool#122) needs correcting to match what's actually implemented and tested.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude here: not changing this. The header and tests match the intended rule; the PR descriptions were stale when this review ran. Per Postgres-Extensions/pgxntool#122 (comment), a file fails only if it has no
\set/\unset ON_ERROR_STOPcommand and does not includepsql.sql, with no on-versus-off distinction. Both PR descriptions now state that rule.