[SCM] PostGIS branch stable-3.4 updated. 3.4.4-46-g304ba2def
git at osgeo.org
git at osgeo.org
Wed Aug 27 03:18:20 PDT 2025
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.4 has been updated
via 304ba2def6aca0067796b6930fd8d7ef0589463a (commit)
from 50c81a79db0246152001f5fe1aeeded55f3af554 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 304ba2def6aca0067796b6930fd8d7ef0589463a
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Aug 27 12:18:05 2025 +0200
Add downgrade testing
References #5977 in 3.4 branch
diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
index 587ea3eff..04471616d 100755
--- a/utils/check_all_upgrades.sh
+++ b/utils/check_all_upgrades.sh
@@ -8,7 +8,7 @@ PGVER=`pg_config --version | awk '{print $2}'`
PGVER_MAJOR=$(echo "${PGVER}" | sed 's/\.[^\.]*//' | sed 's/\(alpha\|beta\|rc\).*//' )
SKIP_LABEL_REGEXP=
echo "INFO: PostgreSQL version: ${PGVER} [${PGVER_MAJOR}]"
-
+MAKE=$(which gmake make | head -1)
BUILDDIR=$PWD # TODO: allow override ?
cd $(dirname $0)/..
@@ -135,6 +135,21 @@ kept_label()
return 0;
}
+# Usage: compatible_from <label> <from>
+compatible_from()
+{
+ label=$1
+ from=$2
+ cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
+ if test $cmp -gt 0; then
+ echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
+ return 1
+ fi
+
+ return 0
+}
+
+# Usage: compatible_upgrade <label> <from> <to>
compatible_upgrade()
{
label=$1
@@ -152,13 +167,32 @@ compatible_upgrade()
echo "SKIP: $label ($to is not newer than $from)"
return 1
fi
- cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
- if test $cmp -gt 0; then
- echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
+
+ if compatible_from $label $from; then
+ return 0
+ else
return 1
fi
+}
- return 0
+check_downgrade()
+{
+ RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+ ${MAKE} -C ${REGDIR} check "TESTS=${SRCDIR}/regress/core/regress.sql" ${MAKE_ARGS} > ${TMPDIR}/log 2>&1
+ if test $? = 0; then
+ echo "FAIL: ${test_label} did not error out:"
+ tail ${TMPDIR}/log
+ failed
+ else
+ ERR=$( grep 'ERROR:.*Downgrade .* forbidden' ${TMPDIR}/log )
+ test -n "$ERR" && {
+ echo "PASS: ${test_label} gave $ERR"
+ } || {
+ echo "FAIL: ${test_label} gave some other error:"
+ tail ${TMPDIR}/log
+ failed
+ }
+ fi
}
report_missing_versions()
@@ -233,12 +267,26 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
continue;
fi
UPGRADE_PATH="${from_version}--${to_version_param}"
- test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+
+ cmp=`semver_compare "${from_version}" "${to_version}"`
+ #echo "INFO: semver_compare ${from} ${to} returned $cmp"
+ if test $cmp -eq 0; then
+ echo "SKIP: ${from_version} -> ${to_version} (we won't test same-version upgrade/downgrade here)"
+ continue;
+ fi
+
+ if test $cmp -lt 0; then
+ test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+ else
+ test_label="${EXT} extension downgrade ${UPGRADE_PATH}"
+ fi
+
if expr $to_version_param : ':auto' >/dev/null; then
test_label="${test_label} ($to_version)"
fi
+
kept_label "${test_label}" || continue
- compatible_upgrade "${test_label}" ${from_version} ${to_version} || continue
+
path=$( psql -XAtc "
SELECT path
FROM pg_catalog.pg_extension_update_paths('${EXT}')
@@ -250,14 +298,30 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
MISSING_EXT_UPGRADES="${from_version} ${MISSING_EXT_UPGRADES}"
continue
fi
+
+ compatible_from "${test_label}" ${from_version} || continue
+
echo "Testing ${test_label}"
- RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
- make -C ${REGDIR} check ${MAKE_ARGS} && {
- echo "PASS: ${test_label}"
- } || {
- echo "FAIL: ${test_label}"
- failed
- }
+
+ if expr "${test_label}" : '^.*upgrade' > /dev/null; then
+ RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+ ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
+ echo "PASS: ${test_label}"
+ } || {
+ echo "FAIL: ${test_label}"
+ failed
+ }
+ else
+ check_downgrade
+
+ test_label="${test_label} with standard-conforming-strings off"
+ echo "Testing ${test_label}"
+ USERTESTFLAGS="\
+ ${USERTESTFLAGS} \
+ --before-upgrade-script ${SRCDIR}/regress/hooks/standard-conforming-strings-off.sql \
+ " check_downgrade
+ fi
+
done
if ! kept_label "unpackaged"; then
@@ -286,7 +350,7 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
fi
echo "Testing ${test_label}"
RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
- make -C ${REGDIR} check ${MAKE_ARGS} && {
+ ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
echo "PASS: ${test_label}"
} || {
echo "FAIL: ${test_label}"
@@ -295,7 +359,8 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
done
# Check unpackaged->unpackaged upgrades (if target version == current version)
- CURRENTVERSION=`grep '^POSTGIS_' ${SRCDIR}/Version.config | cut -d= -f2 | paste -sd '.'`
+# CURRENTVERSION=`grep '^POSTGIS_' ${SRCDIR}/Version.config | cut -d= -f2 | paste -sd '.'`
+ CURRENTVERSION=$(grep '^POSTGIS_' ${SRCDIR}/Version.config | cut -d= -f2 | tr '\n' '.' | sed 's/\.$//')
if test "${to_version}" != "${CURRENTVERSION}"; then #{
echo "SKIP: ${EXT} script-based upgrades (${to_version_param} [${to_version}] does not match built version ${CURRENTVERSION})"
@@ -315,7 +380,7 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
if kept_label "${test_label}"; then #{
echo "Testing ${test_label}"
RUNTESTFLAGS="-v --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
- make -C ${REGDIR} check ${MAKE_ARGS} && {
+ ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
echo "PASS: ${test_label}"
} || {
echo "FAIL: ${test_label}"
@@ -327,7 +392,7 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
if kept_label "${test_label}"; then #{
echo "Testing ${test_label}"
RUNTESTFLAGS="-v --dumprestore --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
- make -C ${REGDIR} check ${MAKE_ARGS} && {
+ ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
echo "PASS: ${test_label}"
} || {
echo "FAIL: ${test_label}"
-----------------------------------------------------------------------
Summary of changes:
utils/check_all_upgrades.sh | 101 ++++++++++++++++++++++++++++++++++++--------
1 file changed, 83 insertions(+), 18 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list