Repository navigation
Adapt to pgxntool 2.4.0 and fix tests for current PostgreSQL - #3
Conversation
The old pgxntool passed `--load-language=plpgsql` to pg_regress, which PG17 rejects, and ignored installcheck errors, so `make test` exited 0 without running anything. pgxntool 2.4.0 runs the suite and fails on regressions, which surfaced: - Makefile: drop the local asciidoc rules; `base.mk` now builds and installs docs itself, and keeping both made `make install` fail with "will not overwrite just-created". - test/expected: remove the `base_94*`, `base_95*` and `base_961` variant files, which have no matching `test/sql` file and fail pgxntool's stale-expected check. Regenerated the rest with `make results`: the installed trunklet now emits a `function__arg_types_text()` deprecation warning on load, and pgTap numbers the `threw` checks in `base` in a different order. - sql/trunklet-format--0.2.0.sql: pgxntool now tracks the current version's generated install script instead of ignoring it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
trunklet's deprecation warning is printed with a `LOCATION:` line naming a `pl_exec.c` line number, which differs between PostgreSQL majors, so the expected output only matched one of them. `test/deps.sql` now sets terse verbosity; expected output regenerated with `make results`. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Order each multi-row test input explicitly (by WITH ORDINALITY / position column, not by value) so pgTAP test numbers don't depend on the join order the planner picks. Each throws_ok/is query reads an ordered subquery or view as its only FROM item so ordering holds on 9.5. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Setting it in test/deps.sql applied it suite-wide. Only the statements that create extensions emit the deprecation warning whose LOCATION line varies by PostgreSQL version, so wrap just those. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Set default_version and the META.json versions to `stable`, so editing the source regenerates the gitignored sql/trunklet-format--stable.sql instead of a released version's install script. Restore sql/trunklet-format--0.2.0.sql to the script that shipped as 0.2.0 (identical to the PGXN 0.2.0 release), and add the 0.2.0--stable update script, which brings a 0.2.0 install up to the current source. Updating from 0.2.0 needs extension_drop created first, because 0.2.0 did not require it; HISTORY.asc and README.md say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The drop command registered by the install and update scripts calls trunklet.template_language__remove() with ignore_missing_functions, which trunklet 0.3.3 added, and the update script uses _trunklet._language_function__create(), added in 0.3.0. Raise both trunklet prereqs to 0.3.3, and say in HISTORY.asc and README.md that updating from 0.2.0 needs trunklet updated first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trunklet has no update script from 0.2.0, so ALTER EXTENSION trunklet UPDATE only works from trunklet 0.2.1 or later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| FROM unnest('{s,L}'::text[]) WITH ORDINALITY r(replace, rn) | ||
| , unnest(array[to_json(1.1), to_json(NULL::int), to_json('text'::text), to_json(true)]) | ||
| WITH ORDINALITY v(value, vn) | ||
| ORDER BY rn, vn |
There was a problem hiding this comment.
Eh, ditch the comment on 96 and just mention -- Ensure consistent ordering against planner changes above the ORDER BY
There was a problem hiding this comment.
Claude here: fixed in 5d02776 — dropped the comment above the SELECT and added -- Ensure consistent ordering against planner changes above the ORDER BY.
| \set saved_verbosity :VERBOSITY | ||
| \set VERBOSITY terse | ||
| DO $$ BEGIN | ||
| IF current_setting('server_version_num')::int < 100000 THEN |
There was a problem hiding this comment.
Do we actually still support < 10.0? I think this whole branch can go.
There was a problem hiding this comment.
Claude here: flagged for review.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The extension_drop/trunklet/cat_tools creates and the non-CASCADE CREATE EXTENSION path only ran on server_version_num < 100000, and the terse-VERBOSITY wrapper existed solely for that block. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adapts trunklet-format to the vendored pgxntool 2.4.0 (merged in #6) so
make testactually runs and passes on current PostgreSQL. The old base.mk passed--load-language=plpgsqlto pg_regress, which PostgreSQL 13 and later reject, and ignored installcheck errors, somake testexited 0 without running any test. pgxntool 2.4.0 runs the suite and exits non-zero on regressions.Changes needed in trunklet-format:
Makefile: removed the local asciidoc rules; base.mk now builds and installs docs itself, and keeping both mademake installfail with "will not overwrite just-created".test/expected/base_94*.out,base_95*.out,base_961.out: removed; they have no matchingtest/sqlfile and fail pgxntool's stale-expected check.test/sql/base.sql: every multi-row test input is now read through anORDER BYon explicit positions, so pgTAP test numbers don't depend on the join order the planner picks. (PostgreSQL 17 joined thethrewchecks' inputs in the other order.)test/load.sql,test/deps.sql,test/sql/{build,reload,search_path}.sql: terse verbosity is set only around the statements that create the extension. extension_drop's install script callsfunction__arg_types_text()from cat_tools 0.3.0 (which extension_drop pulls in), and that prints a deprecation warning; with verbose output the warning gets aLOCATION:line whosepl_exec.cline number differs between PostgreSQL majors.test/expected/*.out: regenerated withmake results(the warning is pinned without itsLOCATION:line). Output contains nonot ok.make testpasses locally on PostgreSQL 12 and 17. The stacked PR #4 adds CI and raises the supported floor to PostgreSQL 12; its run on top of this branch passes on PostgreSQL 12 through 18, for both a fresh install and the update from 0.2.0 (run 40230691469).🤖 Generated with Claude Code