From dd501554c9af60083ff93339b06cc4ff2022fce0 Mon Sep 17 00:00:00 2001 From: a-masterov <72613290+a-masterov@users.noreply.github.com> Date: Tue, 27 May 2025 10:54:59 +0200 Subject: [PATCH] add a script to run the test for online-advisor as a regular user. (#12017) ## Problem The regression test for the extension online_advisor fails on the staging instance due to a lack of permission to alter the database. ## Summary of changes A script was added to work around this problem. --------- Co-authored-by: Alexander Lakhin --- docker-compose/ext-src/online_advisor-src/neon-test.sh | 6 ++++++ .../ext-src/online_advisor-src/regular-test.sh | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100755 docker-compose/ext-src/online_advisor-src/neon-test.sh create mode 100755 docker-compose/ext-src/online_advisor-src/regular-test.sh diff --git a/docker-compose/ext-src/online_advisor-src/neon-test.sh b/docker-compose/ext-src/online_advisor-src/neon-test.sh new file mode 100755 index 0000000000..db5c2821fa --- /dev/null +++ b/docker-compose/ext-src/online_advisor-src/neon-test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -ex +cd "$(dirname "${0}")" +if [ -f Makefile ]; then + make installcheck +fi diff --git a/docker-compose/ext-src/online_advisor-src/regular-test.sh b/docker-compose/ext-src/online_advisor-src/regular-test.sh new file mode 100755 index 0000000000..e94f03aa70 --- /dev/null +++ b/docker-compose/ext-src/online_advisor-src/regular-test.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +[ -f Makefile ] || exit 0 +dropdb --if-exist contrib_regression +createdb contrib_regression +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +TESTS=$(echo sql/* | sed 's|sql/||g; s|\.sql||g') +${PG_REGRESS} --use-existing --inputdir=./ --bindir='/usr/local/pgsql/bin' --dbname=contrib_regression ${TESTS}