Skip to content

Randomize the test extension's (extension_drop_test) name and install schema #37

Description

@jnasbyupgrade

Background

Same underlying principle as extension_drop's own schema-independence (see CLAUDE.md), applied one level over: the test suite exercises extension_drop's __get/__add/__remove commands via a helper "test extension" (extension_drop_test, defined in test/extension/). Nothing the suite is actually testing should depend on:

  • which schema extension_drop_test is installed into, or
  • what extension_drop_test is even named

...but today both are effectively hardcoded/assumed throughout the test files.

Proposed fix (not yet designed in detail)

  • Install extension_drop_test under a randomized name each run, with a constant prefix (e.g. extension_drop_test_<random>) so old/leftover copies from interrupted runs can still be identified and dropped reliably.
  • Install it into a randomized schema too, same as the schema-randomization idea being worked out for extension_drop itself (see the related, separate work happening in pg_count_nulls for the reference pattern, and extension_tools#36 for the current, likely-to-be-superseded interim approach).

Why this is a separate TODO, not immediate work

The test extension's name is hardcoded in a bunch of different places (control file, SQL files, Makefile install rules, test/extension/ naming) — a bigger refactor than simply testing extension_drop itself in a random schema. Deliberately deferred; this issue exists to not lose the idea, not to schedule the work yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions