Skip to content

multi-extension.bats doesn't verify make pgtle actually processes both extensions #71

Description

@jnasbyupgrade

Repo: pgxntool-test

test/standard/multi-extension.bats:110-121 ("make generates versioned SQL
files") runs make pgtle against a template with two control files
(ext_alpha.control, ext_beta.control) — the only place in the suite that
exercises base.mk's pgtle target's $(foreach ext,$(_PGXNTOOL_EXTENSIONS),...)
loop with more than one extension. But the test only asserts:

run make pgtle
assert_success

It never checks that pgtle.sh actually ran for both extensions. Compare
to the adjacent make all assertions in the same file (lines 123-137),
which do check both sql/ext_alpha--1.0.0.sql and sql/ext_beta--2.5.0.sql
exist.

If the pgtle target's multi-extension loop silently dropped to processing
only one extension (e.g. a regression in _PGXNTOOL_EXTENSIONS, née
PGXNTOOL_EXTENSIONS, or in the pgtle recipe's $(foreach ...)), this
test would still pass, since make pgtle only needs to exit 0.

Suggested fix: add assertions that both pg_tle/*/ext_alpha.sql and
pg_tle/*/ext_beta.sql exist after make pgtle (mirroring the versioned-SQL
assertions already in the file).

Found while auditing internal-variable naming conventions for #87 in
pgxntool (checking whether pgxntool-test has test coverage tied to
PGXNTOOL_EXTENSIONS by name — it doesn't, and this is the closest thing,
which turned out to have its own gap).

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