Skip to content

Phase 3: TEST_LOAD_SOURCE (fresh/update/existing) in test/install - #29

Open
jnasbyupgrade wants to merge 1 commit into
phase2-schema-switchingfrom
phase3-load-mode
Open

Phase 3: TEST_LOAD_SOURCE (fresh/update/existing) in test/install#29
jnasbyupgrade wants to merge 1 commit into
phase2-schema-switchingfrom
phase3-load-mode

Conversation

@jnasbyupgrade

Copy link
Copy Markdown
Contributor

Stacked on #28 (phase 2: schema switching). Adds the update+upgrade (U&U) load-mode axis test/install was always meant to carry, per pgxntool/README.asc's documented pattern.

What changed

  • `test/install/load.sql` selects fresh/update/existing via the `count_nulls.test_load_mode` GUC (`TEST_LOAD_SOURCE` make var, same propagation mechanism as `TEST_SCHEMA`):
    • fresh (default): unchanged from phases 1/2.
    • update: `CREATE EXTENSION count_nulls VERSION '0.9.6'` then `ALTER EXTENSION UPDATE` - committed, since `test/install` runs outside any per-test rolled-back transaction (the whole reason this pattern needs `test/install` rather than `test/deps.sql` - a real `ALTER EXTENSION UPDATE` has to actually commit to be tested honestly).
    • existing: asserts count_nulls is already installed and at the current version, touches nothing - for a real `pg_upgrade` run external to this invocation (a later phase adds the CI job that drives this).
  • New `extension-update-test` CI job: just `make verify-results TEST_LOAD_SOURCE=update`. No external script needed for this leg - unlike a real `pg_upgrade`, an in-place update is pure SQL, so `test/install` can do the whole fresh-vs-updated comparison inside one `pg_regress` invocation.

Deliberately does NOT add a dependency guard yet (the "prove a non-CASCADE drop is blocked" mechanism) - that only earns its keep protecting against an EXTERNAL step corrupting state test/install can't see into (a real `pg_upgrade`), which doesn't exist until the next phase. Adding it here would also immediately conflict with the main suite's own `test__shutdown__drop_all`. Also not crossing this new job with `TEST_SCHEMA` yet - that's its own phase, once the real pg_upgrade job exists too so both can cross schema together.

Verification

Locally against PG17: fresh, update, and existing modes all pass via `make verify-results` - zero expected-output changes needed for any combination, including `update` × `TEST_SCHEMA=Quoted` crossed together, confirming phase 2's schema-invariant design holds across load modes too (load-bearing for the later phase that crosses U&U with schema in CI). `existing` mode verified manually against a real out-of-band `CREATE EXTENSION` + `--use-existing` run.

test/install/load.sql now selects fresh/update/existing via the
count_nulls.test_load_mode GUC (TEST_LOAD_SOURCE make var), matching
pgxntool/README.asc's documented U&U pattern:
  - fresh: CREATE EXTENSION count_nulls (unchanged from phase 1/2).
  - update: CREATE EXTENSION VERSION '0.9.6', then ALTER EXTENSION UPDATE -
    committed, since test/install runs outside any per-test rolled-back
    transaction.
  - existing: asserts count_nulls is already installed and current,
    touches nothing - for a real pg_upgrade run external to this
    invocation (a later phase adds the CI job that drives this).

Added the extension-update-test CI job: just `make verify-results
TEST_LOAD_SOURCE=update`, no external script needed - unlike a real
pg_upgrade, an in-place update is pure SQL, so test/install handles the
whole fresh-vs-updated comparison within one pg_regress invocation.

Verified locally against PG17: fresh, update, and existing modes all pass
via make verify-results, including update x TEST_SCHEMA=Quoted crossed
together - zero expected-output changes needed for any combination,
confirming phase 2's schema-invariant design holds across load modes too
(load-bearing for a later phase that crosses U&U with schema in CI).
existing mode verified manually against a real out-of-band CREATE
EXTENSION + --use-existing run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot 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: 0e984f17-ef96-4c2e-9899-89b80243130f

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.

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