Skip to content

Cross extension-update-test/pg-upgrade-test with TEST_SCHEMA - #32

Draft
jnasbyupgrade wants to merge 6 commits into
masterfrom
phase5-cross-schema
Draft

Cross extension-update-test/pg-upgrade-test with TEST_SCHEMA#32
jnasbyupgrade wants to merge 6 commits into
masterfrom
phase5-cross-schema

Conversation

@jnasbyupgrade

@jnasbyupgradejnasbyupgrade commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ SUPERSEDED — this PR is meant to be replaced, not merged as-is. Its premise (crossing pg-upgrade-test/extension-update-test with a fixed ["", Quoted] TEST_SCHEMA matrix) is being replaced by an always-randomize-the-install-schema design instead. Left open for reference only.


Stacked on #31 (phase 4: real pg_upgrade support). This is the novel enhancement the whole redesign was building toward.

Why this is novel

Checked directly: nobody in the org currently tests update/upgrade crossed with schema scenarios. cat_tools' own extension-update-test/pg-upgrade-test matrices are PG-version-only (no schema axis at all - checked its actual ci.yml). extension_tools has no U&U testing whatsoever. So this is genuinely new coverage, not something to copy from a reference implementation.

What changed

  • extension-update-test: added schema: ["", Quoted] to the matrix + a TEST_SCHEMA env var - the job's own make verify-results TEST_LOAD_SOURCE=update picks it up automatically (Make auto-imports matching-named environment variables).
  • pg-upgrade-test: added the same schema axis. old_pg/new_pg were already plain matrix dimensions (not an include: list), so adding a third axis cross-products cleanly into 4 legs (2 old_pg values × 2 schema values). Threaded matrix.schema through to bin/test_existing's prepare-old/run-suite calls, previously hardcoded to "".

Why this is "free": phase 2's schema-invariant assertion descriptions mean crossing either job with TEST_SCHEMA needs zero new expected-output files - every leg of every job (fresh, update, real pg_upgrade) × (no schema, Quoted schema) passes against the exact same test/expected/extension_tests.out (+ the one genuine alternate from phase 2).

Verification

Locally against PG17: prepare-oldupdaterun-suite passes end to end with TEST_SCHEMA=Quoted (previously only verified with an untargeted schema in phase 4).

@coderabbitai

coderabbitaiBot commented Aug 1, 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: e9c92029-e901-43c9-afa5-c1b93a656843

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

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.

@github-actions

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jnasbyupgradejnasbyupgrade changed the title Phase 5: cross extension-update-test/pg-upgrade-test with TEST_SCHEMACross extension-update-test/pg-upgrade-test with TEST_SCHEMAAug 4, 2026
@jnasbyupgrade
jnasbyupgrade marked this pull request as draft August 4, 2026 21:11
@jnasbyupgrade
jnasbyupgradeforce-pushed the phase5-cross-schema branch 2 times, most recently from 1d942ca to 1694173CompareAugust 5, 2026 21:45
@jnasbyupgrade
jnasbyupgradeforce-pushed the phase5-cross-schema branch 2 times, most recently from 293db9f to ee0f795CompareAugust 6, 2026 19:16
@jnasbyupgrade
jnasbyupgradeforce-pushed the phase5-cross-schema branch 2 times, most recently from f3da5c0 to 6e3cca1CompareAugust 6, 2026 22:51
jnasbyupgradeand others added 6 commits August 6, 2026 17:56
…rce PG list
Independent of the U&U testing work itself, but best done now that
multiple CI jobs exist and before the next phase adds the most expensive
one (a real pg_upgrade job):
- `changes` job: computes the actual per-push diff and skips test/
extension-update-test/pg-tle-test entirely on doc-only pushes, always
triggering itself (no workflow-level paths-ignore, which would leave
all-checks-passed stuck Pending on doc-only pushes in branch protection).
- Derives the supported-PostgreSQL-major list from ONE set of constants
(NEWEST/FLOOR) in that same job, consumed by both the `test` and
`extension-update-test` matrices via fromJSON - they can't silently drift
onto different lists, and a new major is a one-line change.
- `all-checks-passed`: single stable required-status-check name, with a
self-check that its own needs list can't silently omit a newly-added job.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The org-wide Actions runner queue backs up easily; a draft PR being
actively iterated on doesn't need the full PG matrix or the heavy
pg-tle-test job re-run on every push. Add a newest_pg scalar output
(single source alongside supported_pg) and reduce the test job's
matrix to just that value on a draft PR, while skipping pg-tle-test
(and any later heavy job following the same needs:[changes]/if:
docs_only pattern) outright. Non-draft PRs and push events (e.g.
post-merge on master) are unaffected.
Adds the pg-upgrade-test CI job: install 0.9.6 on an old PostgreSQL major,
plant + prove a dependency guard, binary pg_upgrade to a newer major,
ALTER EXTENSION UPDATE the migrated objects, then run the suite against
the real upgraded database in existing mode.
bin/test_existing is much smaller than the equivalent script would have
been pre-test/install: only prepare-old and run-suite are genuinely
external-to-pg_regress concerns (a real pg_upgrade binary run isn't
something pg_regress can invoke itself), plus a small `update` subcommand
for the post-upgrade ALTER EXTENSION UPDATE step. There's no
update-scenario subcommand at all - that entire scenario is just `make
test-update` now (test/install/load.sql's own 'update' mode, added in
phase 3), since an in-place update has no external step to drive.
run_suite() gates on plain `make test`, not the old belt-and-suspenders
`make test && make verify-results` - pgxntool 2.3.0 (this repo's phase 0)
already made `make test` itself exit non-zero on regression failures.
Not yet crossed with TEST_SCHEMA - that's the next phase, once both this
job and extension-update-test can cross it together.
Verified locally against PG17 (prepare-old -> update -> run-suite, without
a real pg_upgrade - this container's clusters are persistent shared
infra, so the actual binary pg_upgrade leg is left for CI's ephemeral
containers, same reasoning as the pg-tle-test work).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… not after
Reorders prepare-old -> update -> pg_upgrade -> run-suite (was prepare-old
-> pg_upgrade -> update -> run-suite). The old order proved pg_upgrade
could migrate 0.9.6's frozen objects, then updated afterward - not
actionable, since that version already shipped. This job's whole point is
proving pg_upgrade correctly migrates the objects count_nulls' CURRENT code
creates, which requires updating BEFORE the binary upgrade runs. make
install (into the old cluster) already happens earlier in the job, so the
current version's update scripts are on disk in time for the moved step.
Updates the job's step names/comments and bin/test_existing's own
file-header sequence description to match the new order.
Propagates the draft-PR gating from phase3.5-ci-hygiene to the
pg-upgrade-test job introduced by this branch: same needs:[changes]/
if: docs_only pattern as pg-tle-test, so it gets the same
&& github.event.pull_request.draft != true guard.
…/shell loops, not a matrix
Redesign of the original approach (which crossed TEST_SCHEMA into both
jobs' CI matrices) per the same reasoning as the `test` job's collapse: a
schema name is just an input the same assertions run against, not a real
environment difference.
- extension-update-test: added `make test-update-schema-all` (Makefile),
the same TEST_SCHEMA loop as test-schema-all but with
TEST_LOAD_SOURCE=update. Job step calls it instead of crossing schema
into the matrix.
- pg-upgrade-test: no make-level loop is possible here (bin/test_existing's
steps are shell, not `make test`), so instead prepares TWO databases -
count_nulls_upgrade_none and count_nulls_upgrade_quoted, one per TEST_SCHEMA
value - before the SINGLE pg_upgrade call, which migrates the whole
cluster (every database in it) in one pass. This is strictly better than
a doubled matrix would have been: it also halves the number of actual
pg_upgrade binary invocations (the single most expensive operation in
this job), not just container/checkout overhead.
Verified locally against PG17: prepare-old -> update -> run-suite passes
for both databases in the same cluster/session (no real pg_upgrade run,
same reasoning as prior phases - this container's clusters are persistent
shared infra); make test-update-schema-all passes both TEST_SCHEMA legs.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Base automatically changed from phase4-pg-upgrade to masterAugust 7, 2026 22:30
Sign up for freeto 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

@jnasbyupgrade