Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# See ../ai/RELEASE.md's multi-extension distribution section: an
# extension with no real changes this release cycle keeps its
# <last-released>--stable.sql update script un-renamed (a genuine no-op),
# rather than promoting it to a real versioned update script. That file
# must never ship in a release archive -- nothing in a tagged release
# has default_version = 'stable' for any extension, so a file only
# reachable via that pseudo-version would be permanently unreachable,
# confusing cruft in the archive. Safe as a blanket glob here (unlike
# .gitignore's exact-filename version of this same exclusion): by the
# time `make dist` archives a tag, any extension that DID change already
# had its stable-named file renamed away, so only genuine no-ops can
# still match this pattern.
sql/*--stable.sql export-ignore
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ control.mk

# built targets
# Note: Version-specific files (sql/*--*.sql) are now tracked in git and should be committed
# Exception: the `stable` pseudo-version (default_version between releases,
# see ../ai/RELEASE.md and ../ai/CLAUDE.md's "Version-specific SQL files")
# is permanently current, not a frozen release -- it would be regenerated
# and re-diffed on every source edit for zero test-coverage value if
# tracked. Named explicitly, not `sql/*--stable.sql`: that glob's `*` also
# matches across the second `--`, so it silently swept up the *update*
# scripts too (sql/<ext>--<last-release>--stable.sql, which must stay
# committed -- confirmed the hard way when `git status` didn't show them
# as untracked after creating them).
sql/test_factory--stable.sql
sql/test_factory_pgtap--stable.sql

# Generated by asciidoctor from doc/*.asc; only the .asc source is tracked
doc/*.html
Expand Down
21 changes: 14 additions & 7 deletions bin/test_existing
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#
# run-suite DB
# Assert the installed version matches the current build (never
# hardcoded -- derived from `make -s print-PGXNVERSION`, so a broken
# extraction can't silently compare "" to ""), then run the suite in
# existing mode via --use-existing (pg_regress must not drop/recreate
# DB) and gate on verify-results, not a bare `make test` (pgxntool
# marks installcheck .IGNORE, so a plain test run exits 0 even when
# regression.diffs is nonempty).
# hardcoded -- derived from `make -s print-EXTENSION_test_factory_VERSION`,
# so a broken extraction can't silently compare "" to ""), then run
# the suite in existing mode via --use-existing (pg_regress must not
# drop/recreate DB) and gate on verify-results, not a bare `make test`
# (pgxntool marks installcheck .IGNORE, so a plain test run exits 0
# even when regression.diffs is nonempty).
#
# No separate guard-planting subcommand: unlike cat_tools, test_factory's
# dependency guard (a view in schema test_factory_drop_guard depending on
Expand All @@ -57,8 +57,15 @@ psql_do() {
psql -d "$db" -v ON_ERROR_STOP=1 "$@"
}

# EXTENSION_test_factory_VERSION, not PGXNVERSION: the latter is the
# *distribution* version from META.json, which no longer tracks what
# CREATE EXTENSION actually installs now that test_factory.control's
# default_version sits at the literal 'stable' pseudo-version between
# releases (see ../ai/RELEASE.md) -- a bare CREATE EXTENSION always
# resolves to whatever default_version says, not the distribution's
# semver.
current_version() {
make -s print-PGXNVERSION 2>/dev/null | sed -n 's/.*set to "\(.*\)"$/\1/p'
make -s print-EXTENSION_test_factory_VERSION 2>/dev/null | sed -n 's/.*set to "\(.*\)"$/\1/p'
}

installed_version() {
Expand Down
15 changes: 15 additions & 0 deletions sql/test_factory--0.5.0--stable.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Genuine no-op: nothing in this extension has changed since 0.5.0 yet.
* This file exists purely so ALTER EXTENSION test_factory UPDATE has an
* edge to follow at all -- Postgres's version-graph resolution requires
* an actual sql/test_factory--<from>--<to>.sql file to exist for a
* transition, regardless of whether its content would be a no-op
* (confirmed directly: without this file, ALTER EXTENSION UPDATE fails
* outright with "has no update path from version 0.5.0 to version
* stable", even though nothing would actually need to change). See
* ../ai/RELEASE.md's `stable` pseudo-version workflow: every subsequent
* SQL-touching PR adds whatever ALTER .../CREATE OR REPLACE ... statements
* are needed here to bring an install on 0.5.0 up to that change.
*/

-- vi: expandtab ts=2 sw=2
13 changes: 13 additions & 0 deletions sql/test_factory_pgtap--0.1.0--stable.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Genuine no-op: nothing in this extension has changed since 0.1.0 yet.
* Every extension this distribution provides keeps one of these between
* releases, not just the ones a given change happens to touch -- at
* release time, each extension's own <last-released>--stable.sql is
* inspected to decide whether THAT extension needs a new version (see
* ../ai/RELEASE.md's multi-extension distribution section). An empty
* file here means test_factory_pgtap is not part of this cycle's
* changes and should ship at its existing version, whatever the
* distribution version does.
*/

-- vi: expandtab ts=2 sw=2
2 changes: 1 addition & 1 deletion test_factory.control
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
comment = 'A framework for managing test data'
default_version = '0.5.0'
default_version = 'stable'
relocatable = false
2 changes: 1 addition & 1 deletion test_factory_pgtap.control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
comment = 'A framework for managing test data'
default_version = '0.1.0'
default_version = 'stable'
relocatable = false
requires = 'pgtap, test_factory'