[Git][debian-gis-team/postgis][master] Refactor "ignore tests on some architectures" code.

Christoph Berg (@myon) gitlab at salsa.debian.org
Tue Nov 15 13:58:48 GMT 2022



Christoph Berg pushed to branch master at Debian GIS Project / postgis


Commits:
7eb7d724 by Christoph Berg at 2022-11-15T14:58:35+01:00
Refactor "ignore tests on some architectures" code.

Sync architectures to skip between debian/rules and debian/tests, effectively
re-enabling tests on arm*.

- - - - -


3 changed files:

- debian/changelog
- debian/rules
- debian/tests/test-extension-creation


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+postgis (3.3.2+dfsg-2) UNRELEASED; urgency=medium
+
+  * Refactor "ignore tests on some architectures" code.
+  * Sync architectures to skip between debian/rules and debian/tests,
+    effectively re-enabling tests on arm*.
+
+ -- Christoph Berg <myon at debian.org>  Tue, 15 Nov 2022 14:55:57 +0100
+
 postgis (3.3.2+dfsg-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/rules
=====================================
@@ -17,6 +17,14 @@ include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/pkg-info.mk
 include /usr/share/postgresql-common/pgxs_debian_control.mk
 
+# Ignore testsuite failures on these architectures
+IGNORE_TEST_FAILURE_ARCHS = mips mips64el mipsel s390x alpha hppa hurd-i386 kfreebsd-i386 powerpc ppc64 sparc64
+ifneq (,$(filter $(DEB_BUILD_ARCH),$(IGNORE_TEST_FAILURE_ARCHS)))
+	TEST_FAIL_COMMAND = echo "Ignoring test failures"
+else
+	TEST_FAIL_COMMAND = exit 1
+endif
+
 # Upstream version (including ~rcN) for symbols version
 UPSTREAM_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//')
 
@@ -154,31 +162,16 @@ override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 #	Run unit tests (against the newest Postgres version first)
 	@echo "### PostgreSQL $(NEWEST_POSTGRES_VERSION) test ###"
-# Ignore test failure on problematic architectures
-ifneq (,$(filter $(DEB_BUILD_ARCH),mips mips64el mipsel s390x alpha hppa hurd-i386 kfreebsd-i386 powerpc ppc64 sparc64))
 	pg_virtualenv -v $(NEWEST_POSTGRES_VERSION) \
-		make check RUNTESTFLAGS="-v" || echo "Ignoring test failures"
-else
-	pg_virtualenv -v $(NEWEST_POSTGRES_VERSION) \
-		make check RUNTESTFLAGS="-v"
-endif
+		make check RUNTESTFLAGS="-v" || $(TEST_FAIL_COMMAND)
 
 #	Test against all other Postgres versions
-ifneq (,$(filter $(DEB_BUILD_ARCH),mips mips64el mipsel s390x alpha hppa hurd-i386 kfreebsd-i386 powerpc ppc64 sparc64))
 	set -e; \
 	for PGVER in $(OTHER_POSTGRES_VERSIONS); do \
 		echo "### PostgreSQL $$PGVER test ###"; \
 		pg_virtualenv -v $$PGVER \
-			make -C $(CURDIR)/debian/build-$$PGVER check RUNTESTFLAGS="-v" || echo "Ignoring test failures"; \
+			make -C $(CURDIR)/debian/build-$$PGVER check RUNTESTFLAGS="-v" || $(TEST_FAIL_COMMAND); \
 	done
-else
-	set -e; \
-	for PGVER in $(OTHER_POSTGRES_VERSIONS); do \
-		echo "### PostgreSQL $$PGVER test ###"; \
-		pg_virtualenv -v $$PGVER \
-			make -C $(CURDIR)/debian/build-$$PGVER check RUNTESTFLAGS="-v"; \
-	done
-endif
 endif
 
 override_dh_auto_install:


=====================================
debian/tests/test-extension-creation
=====================================
@@ -8,14 +8,17 @@ unset LC_ALL LANGUAGE
 # Skip tests on problematic architectures
 ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)"
 
-if [ "${ARCH}" = "armel" ] || [ "${ARCH}" = "armhf" ] || [ "${ARCH}" = "mips" ] || [ "${ARCH}" = "mips64el" ] || [ "${ARCH}" = "mipsel" ] || [ "${ARCH}" = "s390x" ] || [ "${ARCH}" = "alpha" ] || [ "${ARCH}" = "hppa" ] || [ "${ARCH}" = "hurd-i386" ] || [ "${ARCH}" = "kfreebsd-i386" ] || [ "${ARCH}" = "powerpc" ] || [ "${ARCH}" = "ppc64" ] || [ "${ARCH}" = "sparc64" ]; then
-  echo "Skipping tests on problematic architectures"
-  exit 77
-fi
+case $ARCH in
+	mips|mips64el|mipsel|s390x|alpha|hppa|hurd-i386|kfreebsd-i386|powerpc|ppc64|sparc64)
+		echo "Ignoring test failures on problematic architectures"
+		TEST_FAIL_EXITCODE=77 ;;
+	*)
+		TEST_FAIL_EXITCODE=1 ;;
+esac
 
 for v in $(pg_buildext installed-versions); do
 	echo "### PostgreSQL $v autopkgtest ###"
-	pg_virtualenv -v $v sh -ex <<-'EOF'
+	pg_virtualenv -v $v sh -ex <<-'EOF' || exit $TEST_FAIL_EXITCODE
 	# test extension (fuzzystrmatch is part of postgresql-contrib and is needed by postgis_tiger_geocoder)
 	for ext in postgis postgis_raster postgis_sfcgal fuzzystrmatch postgis_tiger_geocoder postgis_topology address_standardizer address_standardizer_data_us; do
 		psql -Xc "CREATE EXTENSION $ext"



View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis/-/commit/7eb7d724106292c82e7ffb061868da35a9565981

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis/-/commit/7eb7d724106292c82e7ffb061868da35a9565981
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20221115/0c5e7fe7/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list