Skip to content

Fix results ordering, control file whitespace, ENABLE_* overrides#19

Merged
jnasbyupgrade merged 4 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-pr69-issues
Jul 14, 2026
Merged

Fix results ordering, control file whitespace, ENABLE_* overrides#19
jnasbyupgrade merged 4 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:fix-pr69-issues

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented May 14, 2026

Copy link
Copy Markdown
Contributor

Related pgxntool PR: Postgres-Extensions/pgxntool#31

Summary

Tests and template updates for pgxntool PR #31:

  • make-results.bats: new test verifying verify-results blocks make results when tests are failing (exercises the fixed results: test verify-results ordering)
  • test-verify-results.bats: realigned to the new results: test ordering — verify-results now runs the suite, so tests that assumed otherwise were updated/renamed, with clarifying comments
  • New 04-pgtle.bats test: pgtle.sh correctly handles multiple spaces and a tab before a trailing comment in control files
  • template-multi-extension/ext_beta.control: use multiple spaces before trailing comment to exercise whitespace trimming
  • multi-extension.bats: update comments for multiple-spaces testing
  • Template test SQL: add \set ECHO none to base.sql/pgxntool-test.sql so pg_regress output is stable across psql versions, and regenerate the matching expected output — fixes a latent template mismatch that #31's verify-results: test change surfaced
  • test.md agent: fix debug level description (the BATS $TESTDEBUG 1–5 scale is separate from lib.sh's verbosity scale)

@jnasbyupgrade jnasbyupgrade changed the title Add tests for pgxntool PR #31 (fix results ordering, whitespace, overrides) Fix results ordering, control file whitespace, ENABLE_* overrides May 15, 2026
@jnasbyupgrade

Copy link
Copy Markdown
Contributor Author

@claude please review this PR.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7d46b7d1-16a4-4ff3-8811-a2e698afb0e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jnasbyupgrade jnasbyupgrade force-pushed the master branch 2 times, most recently from 2ef76e6 to 44c65bc Compare July 14, 2026 22:37
jnasbyupgrade and others added 4 commits July 14, 2026 17:59
…ce, overrides)

Add tests/updates for pgxntool commit 20c2552:
- Fix `results:` ordering: `verify-results` now runs after `test` (not before)
- Fix `parse_control_file` trailing whitespace stripping (multiple spaces/tabs)
- Add `override` to `PGXNTOOL_ENABLE_*` so command-line values are normalized

- `make-results.bats`: new test verifying `verify-results` blocks `make results`
  when tests are failing; updated comments
- `test-verify-results.bats`: remove `make results` assertion (now requires
  PostgreSQL since `make results` runs `make test` first); add clarifying comments
- New `04-pgtle.bats` test: `pgtle.sh` handles multiple spaces and tab before
  trailing comment in control files
- `template-multi-extension/ext_beta.control`: use multiple spaces before
  trailing comment to exercise whitespace trimming
- `multi-extension.bats`: update comments for multiple-spaces testing
- `test.md` agent: fix debug level description (BATS 1–5 scale vs `lib.sh` 10–50)
- `gather-repo-info.sh`: add sanity check for invalid debug levels

Co-Authored-By: Claude <noreply@anthropic.com>
Updates for pgxntool commit 6e707bb (clarify debug() level scheme):
- `lib.sh` comment updated to range-based scheme (1-9, 10-19, 20-29...)

`test/lib/helpers.bash`: `debug()` now checks `$TESTDEBUG` instead of `$DEBUG`,
so test infrastructure verbosity and pgxntool script verbosity are independently
controlled. Use `TESTDEBUG=N` for test runs, `DEBUG=N` for pgxntool scripts.

`.claude/skills/commit/SKILL.md`: Added Step 2b — advisory scan of debug level
distribution in changed pgxntool `.sh` files at commit time. Flags scripts with
loops but only single-digit levels, or 5+ calls all at the same level.

`.claude/agents/test.md`, `.claude/settings.json`: Updated all `DEBUG=` references
to `TESTDEBUG=`; corrected stale debug level descriptions to match helpers.bash.

`.claude/skills/test/scripts/run-tests.sh`: Derive `PGPORT` from `PGCLUSTER` at
startup so pg_regress and raw PostgreSQL binaries use the correct cluster port.

Co-Authored-By: Claude <noreply@anthropic.com>
The commit-time check flagged any two-digit level not divisible by 10, contradicting the debug() scheme (levels are anchors, not strict multiples -- 11/15/25 are fine). Overkill; removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The template's base.sql/pgxntool-test.sql lacked \set ECHO none, so pg_regress echoed SQL input into results and the expected files didn't match. Dormant until pgxntool's verify-results began re-running the suite (the ordering fix in the paired pgxntool PR), which surfaced it. Add \set ECHO none and regenerate expected output. Also update test-verify-results.bats to assert the new "verify-results depends on test" behavior instead of the old ordering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jnasbyupgrade jnasbyupgrade merged commit 2299ffd into Postgres-Extensions:master Jul 14, 2026
9 checks passed
jnasbyupgrade added a commit to Postgres-Extensions/pgxntool that referenced this pull request Jul 14, 2026
…ug levels (#31)

Related pgxntool-test PR:
Postgres-Extensions/pgxntool-test#19

## Summary

- Fix `results:` prerequisite ordering: `verify-results` ran before
`make test`, checking stale `regression.diffs` from a prior run;
reordered to `results: test verify-results`
- Fix `parse_control_file` trailing whitespace: `${value%% }` only
stripped one trailing space; now uses a regex to strip all trailing
spaces and tabs (e.g. `default_version = '1.0.0' # comment`)
- Add `override` to
`PGXNTOOL_ENABLE_TEST_BUILD`/`PGXNTOOL_ENABLE_TEST_INSTALL` so
command-line values are normalized by `pgxntool_validate_yesno` rather
than silently ignored
- Fix `pgtle.sh` debug levels: stray single-digit values (1–4) replaced
with verbosity tiers (30/40/50) consistent with the `lib.sh` scheme
- Rework the `debug()` level docs in `lib.sh` and
`.claude/development.md`: levels encode **verbosity/esotericness, not
code nesting depth** (a top-level line can be high if it's esoteric;
loop-body detail is high because it's noisy). The `10/20/30/40/50` tiers
are anchors, not strict multiples of 10 — any in-range value is fine, so
fine-tuning needs no renumbering
- Clarify `CLAUDE.md` audience: for extension developers using pgxntool,
not contributors; redirect contributors to `.claude/`
- Move developer guidelines (Makefile `:=` rules, debug level rules)
from `CLAUDE.md` into `.claude/development.md`, which also now
prominently states that pgxntool changes must be made from a
pgxntool-test checkout
- Update `HISTORY.asc` with entries for the two user-visible fixes

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant