[SCM] PostGIS branch master updated. 3.4.0rc1-714-g52bfcd5fa

git at osgeo.org git at osgeo.org
Fri Oct 27 00:21:18 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, master has been updated
       via  52bfcd5faa3a7577292814d0a5a17c5698a9032f (commit)
      from  f55ce0f0bb7f454ce070b394bfb6fb77bacc5f59 (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 52bfcd5faa3a7577292814d0a5a17c5698a9032f
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Oct 27 08:57:58 2023 +0200

    run_test.pl: allow using custom postgresql role for extension creation
    
    If a POSTGIS_REGRESS_ROLE_EXT_CREATOR environment variable is
    found non-empty, the given role will be used to create the extensions.

diff --git a/regress/run_test.pl b/regress/run_test.pl
index 11d0dabf6..a92d7bd55 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -49,6 +49,8 @@ BEGIN {
 
 our $DB = $ENV{"POSTGIS_REGRESS_DB"} || "postgis_reg";
 our $REGDIR = $ENV{"POSTGIS_REGRESS_DIR"} || abs_path(dirname($0));
+our $DB_ROLE_EXT_MKR = $ENV{"POSTGIS_REGRESS_ROLE_EXT_CREATOR"};
+
 our $TOP_SOURCEDIR = ${REGDIR} . '/..';
 our $ABS_TOP_SOURCEDIR = abs_path(${TOP_SOURCEDIR});
 our $TOP_BUILDDIR = $ENV{"POSTGIS_TOP_BUILD_DIR"};
@@ -755,6 +757,17 @@ Options:
   --after-test-script <path>
                   script to load after each test run
                   (multiple switches supported, to be run in given order)
+Environment Variables:
+  POSTGIS_REGRESS_DB
+                  Name of database to create and use for regression tests.
+                  Defaults to "postgis_reg"
+  POSTGIS_REGRESS_DIR
+                  Base directory of regress tests. Defaults to
+                  name of directory containing this script.
+  POSTGIS_REGRESS_ROLE_EXT_CREATOR
+                  PostgreSQL role to switch to for creating the
+                  postgis extensions.
+
 };
 
 }
@@ -1499,7 +1512,7 @@ sub create_db
 sub create_spatial
 {
     my ($cmd, $rv);
-    print "Creating database '$DB' \n";
+    print "Creating database '$DB'.\n";
 
     $rv = create_db();
 
@@ -1571,6 +1584,11 @@ sub prepare_spatial_extensions
 	# ON_ERROR_STOP is used by psql to return non-0 on an error
 	my $psql_opts = "--no-psqlrc --variable ON_ERROR_STOP=true";
 
+	if ( $DB_ROLE_EXT_MKR ) {
+		print "Using role '$DB_ROLE_EXT_MKR' for spatial extensions creation.\n";
+		$psql_opts .= " -c \"set role='$DB_ROLE_EXT_MKR'\"";
+	}
+
 	my $sql = "CREATE SCHEMA IF NOT EXISTS ${OPT_SCHEMA}";
 	my $cmd = "psql $psql_opts -c \"". $sql . "\" $DB >> $REGRESS_LOG 2>&1";
 	my $rv = system($cmd);

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

Summary of changes:
 regress/run_test.pl | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list