[postgis-tickets] [SCM] PostGIS branch stable-2.5 updated. 2.5.8-8-g6201c2fe7

git at osgeo.org git at osgeo.org
Thu Nov 10 07:41:07 PST 2022


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-2.5 has been updated
       via  6201c2fe7ed482d59082308ef2d69c8d4f4caf08 (commit)
      from  7e1ee433ecb6386de9065f26e266851ec562ca23 (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 6201c2fe7ed482d59082308ef2d69c8d4f4caf08
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Nov 10 13:02:34 2022 +0100

    Re-enable upgrade-with-data tests
    
    Closes #5214 in 2.5 branch

diff --git a/raster/test/regress/Makefile.in b/raster/test/regress/Makefile.in
index ab7049810..309900912 100644
--- a/raster/test/regress/Makefile.in
+++ b/raster/test/regress/Makefile.in
@@ -140,7 +140,7 @@ TEST_SREL = \
 	rt_samealignment \
 	rt_geos_relationships \
 	rt_iscoveragetile
-	
+
 TEST_BUGS = \
 	bug_test_car5 \
 	permitted_gdal_drivers \
@@ -177,7 +177,16 @@ rtpostgis.sql: ../../rt_pg/rtpostgis.sql
 	$(PERL) -lpe "s'\\\$$libdir'$(REGRESS_INSTALLDIR)/lib'g" $< > $@
 
 
-check: 
+check:
 	$(MAKE) -C ../../../regress staged-install
 	$(PERL) ../../../regress/run_test.pl --raster $(RUNTESTFLAGS) $(TESTS)
-	$(PERL) ../../../regress/run_test.pl --upgrade --raster $(RUNTESTFLAGS) $(TESTS)
+	# only run upgrade test if RUNTESTFLAGS was not already doing that
+	if echo "$(RUNTESTFLAGS)" | grep -vq -- --upgrade; then \
+		$(PERL) ../../../regress/run_test.pl \
+			--raster \
+			--upgrade \
+			--before-upgrade-script hooks/hook-before-upgrade-raster.sql \
+			--after-upgrade-script hooks/hook-after-upgrade-raster.sql \
+			$(RUNTESTFLAGS) \
+			$(TESTS); \
+	fi
diff --git a/raster/test/regress/hooks/hook-after-upgrade-raster.sql b/raster/test/regress/hooks/hook-after-upgrade-raster.sql
new file mode 100644
index 000000000..49f51173b
--- /dev/null
+++ b/raster/test/regress/hooks/hook-after-upgrade-raster.sql
@@ -0,0 +1 @@
+DROP TABLE upgrade_test_raster;
diff --git a/raster/test/regress/hooks/hook-before-upgrade-raster.sql b/raster/test/regress/hooks/hook-before-upgrade-raster.sql
new file mode 100644
index 000000000..8c000dbaf
--- /dev/null
+++ b/raster/test/regress/hooks/hook-before-upgrade-raster.sql
@@ -0,0 +1,16 @@
+CREATE TABLE upgrade_test_raster(r raster);
+INSERT INTO upgrade_test_raster(r) VALUES
+(
+	ST_AddBand(
+		ST_MakeEmptyRaster(
+			10, 10, 1, 1, 2, 2, 0, 0,4326
+		),
+		1,
+		'8BSI'::text,
+		-129,
+		NULL
+	)
+);
+
+--SET client_min_messages TO ERROR;
+SELECT AddRasterConstraints('upgrade_test_raster', 'r');
diff --git a/regress/Makefile.in b/regress/Makefile.in
index 47ac973c8..bee640c48 100644
--- a/regress/Makefile.in
+++ b/regress/Makefile.in
@@ -305,8 +305,17 @@ staged-install: staged-install-raster staged-install-topology
 	#$(MAKE) -C ../loader REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install
 
 test check: staged-install
-	$(PERL) run_test.pl $(RUNTESTFLAGS) $(SFCGALTESTFLAGS) $(TESTS) && \
-	$(PERL) run_test.pl --upgrade $(RUNTESTFLAGS) $(SFCGALTESTFLAGS) $(TESTS)
+	$(PERL) run_test.pl $(RUNTESTFLAGS) $(SFCGALTESTFLAGS) $(TESTS)
+	# only run upgrade test if RUNTESTFLAGS was not already doing that
+	if echo "$(RUNTESTFLAGS)" | grep -vq -- --upgrade; then \
+		$(PERL) run_test.pl \
+			--upgrade \
+			--before-upgrade-script hooks/hook-before-upgrade.sql \
+			--after-upgrade-script hooks/hook-after-upgrade.sql \
+			$(RUNTESTFLAGS) \
+			$(SFCGALTESTFLAGS) \
+			$(TESTS); \
+	fi
 
 garden:
 	createdb postgis_garden
diff --git a/regress/hooks/hook-after-upgrade.sql b/regress/hooks/hook-after-upgrade.sql
new file mode 100644
index 000000000..459f80249
--- /dev/null
+++ b/regress/hooks/hook-after-upgrade.sql
@@ -0,0 +1,2 @@
+DROP VIEW IF EXISTS upgrade_view_test;
+DROP TABLE upgrade_test;
diff --git a/regress/hooks/hook-before-upgrade.sql b/regress/hooks/hook-before-upgrade.sql
new file mode 100644
index 000000000..d4bcb8cd6
--- /dev/null
+++ b/regress/hooks/hook-before-upgrade.sql
@@ -0,0 +1,26 @@
+CREATE TABLE upgrade_test(g1 geometry, g2 geography);
+INSERT INTO upgrade_test(g1,g2) VALUES
+('POINT(0 0)', 'LINESTRING(0 0, 1 1)'),
+('POINT(1 0)', 'LINESTRING(0 1, 1 1)');
+
+-- We know upgrading with an st_union() based view
+-- fails unless you're on PostgreSQL 12, so we don't
+-- even try that.
+--
+-- We could re-enable this test IF we fix the upgrade
+-- in pre-12 versions. Refer to
+-- https://trac.osgeo.org/postgis/ticket/4386
+--
+DO $BODY$
+DECLARE
+	vernum INT;
+BEGIN
+	show server_version_num INTO vernum;
+	IF vernum >= 120000
+	THEN
+		RAISE DEBUG '12+ server (%)', vernum;
+    CREATE VIEW upgrade_view_test AS
+    SELECT ST_Union(g1) FROM upgrade_test;
+	END IF;
+END;
+$BODY$ LANGUAGE 'plpgsql';
diff --git a/topology/test/Makefile.in b/topology/test/Makefile.in
index 4ce207787..c08ecf218 100644
--- a/topology/test/Makefile.in
+++ b/topology/test/Makefile.in
@@ -77,4 +77,13 @@ TESTS_EXPECTED = $(TESTS:.sql=_expected)
 check: topo_predicates.sql load_topology.sql load_topology-4326.sql $(TESTS) $(TESTS_EXPECTED)
 	$(MAKE) -C ../../regress staged-install
 	$(PERL) ../../regress/run_test.pl --topology $(RUNTESTFLAGS) $(TESTS)
-	$(PERL) ../../regress/run_test.pl --upgrade --topology $(RUNTESTFLAGS) $(TESTS)
+	# only run upgrade test if RUNTESTFLAGS was not already doing that
+	if echo "$(RUNTESTFLAGS)" | grep -vq -- --upgrade; then \
+		$(PERL) ../../regress/run_test.pl \
+			--upgrade \
+			--topology \
+			--before-upgrade-script regress/hooks/hook-before-upgrade-topology.sql \
+			--after-upgrade-script regress/hooks/hook-after-upgrade-topology.sql \
+			$(RUNTESTFLAGS) \
+			$(TESTS); \
+	fi
diff --git a/topology/test/regress/hooks/hook-after-upgrade-topology.sql b/topology/test/regress/hooks/hook-after-upgrade-topology.sql
new file mode 100644
index 000000000..c7e2e9ce8
--- /dev/null
+++ b/topology/test/regress/hooks/hook-after-upgrade-topology.sql
@@ -0,0 +1,2 @@
+SELECT topology.DropTopology('upgrade_test');
+
diff --git a/topology/test/regress/hooks/hook-before-upgrade-topology.sql b/topology/test/regress/hooks/hook-before-upgrade-topology.sql
new file mode 100644
index 000000000..9c5529f7e
--- /dev/null
+++ b/topology/test/regress/hooks/hook-before-upgrade-topology.sql
@@ -0,0 +1,2 @@
+SELECT topology.createTopology('upgrade_test');
+

-----------------------------------------------------------------------

Summary of changes:
 raster/test/regress/Makefile.in                    | 15 ++++++++++---
 .../regress/hooks/hook-after-upgrade-raster.sql    |  1 +
 .../regress/hooks/hook-before-upgrade-raster.sql   | 16 +++++++++++++
 regress/Makefile.in                                | 13 +++++++++--
 regress/hooks/hook-after-upgrade.sql               |  2 ++
 regress/hooks/hook-before-upgrade.sql              | 26 ++++++++++++++++++++++
 topology/test/Makefile.in                          | 11 ++++++++-
 .../regress/hooks/hook-after-upgrade-topology.sql  |  2 ++
 .../regress/hooks/hook-before-upgrade-topology.sql |  2 ++
 9 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 raster/test/regress/hooks/hook-after-upgrade-raster.sql
 create mode 100644 raster/test/regress/hooks/hook-before-upgrade-raster.sql
 create mode 100644 regress/hooks/hook-after-upgrade.sql
 create mode 100644 regress/hooks/hook-before-upgrade.sql
 create mode 100644 topology/test/regress/hooks/hook-after-upgrade-topology.sql
 create mode 100644 topology/test/regress/hooks/hook-before-upgrade-topology.sql


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list