[postgis-tickets] [SCM] PostGIS branch stable-3.4 updated. 3.4.0-39-ge9f3ad081
git at osgeo.org
git at osgeo.org
Tue Oct 17 16:05:33 PDT 2023
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 e9f3ad081965136aefb78a91498ca617a541fe83 (commit)
from e5dd8a1b8dfd0133dc3a51f7a73f4b4b49109f51 (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 e9f3ad081965136aefb78a91498ca617a541fe83
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Oct 18 01:02:27 2023 +0200
Add hard-upgrade testing and --skip switch to check_all_upgrades
You can disable hard-upgrade testing by passing `--skip hard`
You can disable unpacakged upgrades by passing `--skip unpackaged`
Closes #5573
diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
index 6d6de5c73..b7710d582 100755
--- a/utils/check_all_upgrades.sh
+++ b/utils/check_all_upgrades.sh
@@ -6,7 +6,7 @@ CTBDIR=`pg_config --sharedir`/contrib/
TMPDIR=/tmp/check_all_upgrades-$$-tmp
PGVER=`pg_config --version | awk '{print $2}'`
PGVER_MAJOR=$(echo "${PGVER}" | sed 's/\.[^\.]*//' | sed 's/\(alpha\|beta\|rc\).*//' )
-CHECK_UNPACKAGED=0
+SKIP_LABEL_REGEXP=
echo "INFO: PostgreSQL version: ${PGVER} [${PGVER_MAJOR}]"
BUILDDIR=$PWD # TODO: allow override ?
@@ -18,16 +18,30 @@ cd - > /dev/null
# This is useful to run database queries
export PGDATABASE=template1
+usage() {
+ echo "Usage: $0 [-s] <to_version>"
+ echo "Options:"
+ echo "\t-s Stop on first failure"
+ echo "\t--skip <regexp> Do not run tests with label matching given extended regexp"
+}
-if test "$1" = "-s"; then
- EXIT_ON_FIRST_FAILURE=1
+while test -n "$1"; do
+ if test "$1" = "-s"; then
+ EXIT_ON_FIRST_FAILURE=1
+ elif test "$1" = "--skip"; then
+ shift
+ SKIP_LABEL_REGEXP=$1
+ elif test -z "$to_version_param"; then
+ to_version_param="$1"
+ else
+ usage >&2
+ exit 1
+ fi
shift
-fi
+done
-if test -z "$1"; then
- echo "Usage: $0 [-s] <to_version>" >&2
- echo "Options:" >&2
- echo "\t-s Stop on first failure" >&2
+if test -z "$to_version_param"; then
+ usage >&2
exit 1
fi
@@ -105,6 +119,20 @@ EOF
echo "${minsupported}"
}
+kept_label()
+{
+ label=$1
+
+ if test -n "${SKIP_LABEL_REGEXP}"; then
+ if echo "${label}" | egrep -q "${SKIP_LABEL_REGEXP}"; then
+ echo "SKIP: $label (matches regexp '${SKIP_LABEL_REGEXP}')"
+ return 1;
+ fi
+ fi
+
+ return 0;
+}
+
compatible_upgrade()
{
label=$1
@@ -141,7 +169,6 @@ report_missing_versions()
}
-to_version_param="$1"
to_version=$to_version_param
if expr $to_version : ':auto' >/dev/null; then
to_version=`psql -XAtc "select default_version from pg_available_extensions where name = 'postgis'"` || exit 1
@@ -172,13 +199,14 @@ echo "INFO: installed extensions: $INSTALLED_EXTENSIONS"
USERTESTFLAGS=${RUNTESTFLAGS}
# Make use of all public functions defined by source version
+# and use double-upgrade
USERTESTFLAGS="\
${USERTESTFLAGS} \
--before-upgrade-script ${SRCDIR}/regress/hooks/use-all-functions.sql \
--after-upgrade-script ${SRCDIR}/regress/hooks/hook-after-upgrade.sql \
"
-for EXT in ${INSTALLED_EXTENSIONS}; do
+for EXT in ${INSTALLED_EXTENSIONS}; do #{
if test "${EXT}" = "postgis"; then
REGDIR=${BUILDDIR}/regress
elif test "${EXT}" = "postgis_topology"; then
@@ -195,11 +223,16 @@ for EXT in ${INSTALLED_EXTENSIONS}; do
files=`'ls' ${EXT}--* | grep -v -- '--.*--' | sed "s/^${EXT}--\(.*\)\.sql/\1/"`
for fname in $files; do
from_version="$fname"
+ if test "$from_version" = "unpackaged"; then
+ # We deal with unpackaged tests separately
+ continue;
+ fi
UPGRADE_PATH="${from_version}--${to_version_param}"
test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
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
@@ -214,7 +247,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 -C ${REGDIR} check ${MAKE_ARGS} && {
echo "PASS: ${test_label}"
} || {
echo "FAIL: ${test_label}"
@@ -222,62 +255,83 @@ for EXT in ${INSTALLED_EXTENSIONS}; do
}
done
+ if ! kept_label "unpackaged"; then
+ echo "SKIP: ${EXT} script-based upgrades (disabled by commandline)"
+ continue;
+ fi
+
# Check unpackaged->extension upgrades
- if test $CHECK_UNPACKAGED != 0; then
- for majmin in `'ls' -d ${CTBDIR}/postgis-* | sed 's/.*postgis-//'`; do
- UPGRADE_PATH="unpackaged${majmin}--${to_version_param}"
- test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
- if expr $to_version_param : ':auto' >/dev/null; then
- test_label="${test_label} ($to_version)"
- fi
- compatible_upgrade "${test_label}" ${majmin} ${to_version} || continue
- path=$( psql -XAtc "
- SELECT path
- FROM pg_catalog.pg_extension_update_paths('${EXT}')
- WHERE source = 'unpackaged'
- AND target = '${to_version}'
- " ) || exit 1
- if test -z "${path}"; then
- echo "SKIP: ${test_label} (no upgrade path from unpackaged to ${to_version} known by postgresql)"
- continue
- fi
+ for majmin in `'ls' -d ${CTBDIR}/postgis-* | sed 's/.*postgis-//'`; do
+ UPGRADE_PATH="unpackaged${majmin}--${to_version_param}"
+ test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+ 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}" ${majmin} ${to_version} || continue
+ path=$( psql -XAtc "
+ SELECT path
+ FROM pg_catalog.pg_extension_update_paths('${EXT}')
+ WHERE source = 'unpackaged'
+ AND target = '${to_version}'
+ " ) || exit 1
+ if test -z "${path}"; then
+ echo "SKIP: ${test_label} (no upgrade path from unpackaged to ${to_version} known by postgresql)"
+ continue
+ fi
+ 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
+ }
+ done
+
+ # Check unpackaged->unpackaged upgrades (if target version == current version)
+ CURRENTVERSION=`grep '^POSTGIS_' ${SRCDIR}/Version.config | cut -d= -f2 | paste -sd '.'`
+
+ if test "${to_version}" != "${CURRENTVERSION}"; then #{
+ echo "SKIP: ${EXT} script-based upgrades (${to_version_param} [${to_version}] does not match built version ${CURRENTVERSION})"
+ continue
+ fi #}
+
+ for majmin in `'ls' -d ${CTBDIR}/postgis-* | sed 's/.*postgis-//'`
+ do #{
+ UPGRADE_PATH="unpackaged${majmin}--:auto"
+ test_label="${EXT} script soft upgrade ${UPGRADE_PATH}"
+ if expr $to_version_param : ':auto' >/dev/null; then
+ test_label="${test_label} ($to_version)"
+ fi
+
+ compatible_upgrade "${test_label}" ${majmin} ${to_version} || continue
+
+ if kept_label "${test_label}"; then #{
echo "Testing ${test_label}"
- RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
- make -C ${REGDIR} check && {
+ RUNTESTFLAGS="-v --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+ make -C ${REGDIR} check ${MAKE_ARGS} && {
echo "PASS: ${test_label}"
} || {
echo "FAIL: ${test_label}"
failed
}
- done
- fi
-
- # Check unpackaged->unpackaged upgrades
- if test $CHECK_UNPACKAGED != 0; then
- CURRENTVERSION=`grep '^POSTGIS_' ${SRCDIR}/Version.config | cut -d= -f2 | paste -sd '.'`
- if test "${to_version}" = "${CURRENTVERSION}"; then
- for majmin in `'ls' -d ${CTBDIR}/postgis-* | sed 's/.*postgis-//'`
- do #{
- UPGRADE_PATH="unpackaged${majmin}--:auto"
- test_label="${EXT} script-based upgrade ${UPGRADE_PATH}"
- if expr $to_version_param : ':auto' >/dev/null; then
- test_label="${test_label} ($to_version)"
- fi
- compatible_upgrade "${test_label}" ${majmin} ${to_version} || continue
- echo "Testing ${test_label}"
- RUNTESTFLAGS="-v --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
- make -C ${REGDIR} check && {
- echo "PASS: ${test_label}"
- } || {
- echo "FAIL: ${test_label}"
- failed
- }
- done #}
- else #}{
- echo "SKIP: ${EXT} script-based upgrades (${to_version_param} [${to_version}] does not match built version ${CURRENTVERSION})"
fi #}
- fi
-done
+ test_label="${EXT} script hard upgrade ${UPGRADE_PATH}"
+ if kept_label "${test_label}"; then #{
+ echo "Testing ${test_label}"
+ RUNTESTFLAGS="-v --dumprestore --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+ make -C ${REGDIR} check ${MAKE_ARGS} && {
+ echo "PASS: ${test_label}"
+ } || {
+ echo "FAIL: ${test_label}"
+ failed
+ }
+ fi #}
+
+ done #}
+
+done #}
exit $failures
-----------------------------------------------------------------------
Summary of changes:
utils/check_all_upgrades.sh | 170 +++++++++++++++++++++++++++++---------------
1 file changed, 112 insertions(+), 58 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list