From 2eaaa0495ab1adecd198fc944e61e745e10c0af7 Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Fri, 4 Apr 2025 12:28:38 +0200 Subject: [PATCH] Add tests for a cloud instance --- docker-compose/ext-src/pgx_ulid-src/Makefile | 3 ++- docker-compose/ext-src/plv8-src/regular-test.sh | 11 +++++++++++ .../ext-src/postgresql-unit-src/regular-test.sh | 7 +++++++ docker-compose/ext-src/prefix-src/regular-test.sh | 7 +++++++ .../ext-src/rag_bge_small_en_v15-src/Makefile | 9 +++++++-- .../ext-src/rag_jina_reranker_v1_tiny_en-src/Makefile | 9 +++++++-- docker-compose/ext-src/rum-src/regular-test.sh | 7 +++++++ 7 files changed, 48 insertions(+), 5 deletions(-) create mode 100755 docker-compose/ext-src/plv8-src/regular-test.sh create mode 100755 docker-compose/ext-src/postgresql-unit-src/regular-test.sh create mode 100755 docker-compose/ext-src/prefix-src/regular-test.sh create mode 100755 docker-compose/ext-src/rum-src/regular-test.sh diff --git a/docker-compose/ext-src/pgx_ulid-src/Makefile b/docker-compose/ext-src/pgx_ulid-src/Makefile index 582c3b6557..6480c48441 100644 --- a/docker-compose/ext-src/pgx_ulid-src/Makefile +++ b/docker-compose/ext-src/pgx_ulid-src/Makefile @@ -4,7 +4,7 @@ PGFILEDESC = "pgx_ulid - ULID type for PostgreSQL" PG_CONFIG ?= pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) -PG_REGRESS = $(shell dirname $(PGXS))/../../src/test/regress/pg_regress +PG_REGRESS = $(dir $(PGXS))/../../src/test/regress/pg_regress PG_MAJOR_VERSION := $(word 2, $(subst ., , $(shell $(PG_CONFIG) --version))) ifeq ($(shell test $(PG_MAJOR_VERSION) -lt 17; echo $$?),0) REGRESS = 00_ulid_generation 01_ulid_conversions 03_ulid_errors @@ -14,6 +14,7 @@ else EXTNAME = pgx_ulid endif +.PHONY: installcheck installcheck: regression-test regression-test: diff --git a/docker-compose/ext-src/plv8-src/regular-test.sh b/docker-compose/ext-src/plv8-src/regular-test.sh new file mode 100755 index 0000000000..4fe6be7788 --- /dev/null +++ b/docker-compose/ext-src/plv8-src/regular-test.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -ex +cd "$(dirname ${0})" +dropdb --if-exist contrib_regression +createdb contrib_regression +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +REGRESS="$(make -n installcheck | awk '{print substr($0,index($0,"init-extension"));}')" +REGRESS="${REGRESS/startup_perms/}" +REGRESS="${REGRESS/startup /}" +REGRESS="${REGRESS/find_function_perms/}" +${PG_REGRESS} --inputdir=./ --bindir='/usr/local/pgsql/bin' --use-existing --dbname=contrib_regression ${REGRESS} \ No newline at end of file diff --git a/docker-compose/ext-src/postgresql-unit-src/regular-test.sh b/docker-compose/ext-src/postgresql-unit-src/regular-test.sh new file mode 100755 index 0000000000..80b0eb8ba2 --- /dev/null +++ b/docker-compose/ext-src/postgresql-unit-src/regular-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +dropdb --if-exist contrib_regression +createdb contrib_regression +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +${PG_REGRESS} --inputdir=./ --bindir='/usr/local/pgsql/bin' --use-existing --dbname=contrib_regression extension tables unit binary unicode prefix units time temperature functions language_functions round derived compare aggregate iec custom crosstab convert \ No newline at end of file diff --git a/docker-compose/ext-src/prefix-src/regular-test.sh b/docker-compose/ext-src/prefix-src/regular-test.sh new file mode 100755 index 0000000000..d25d6ed7b9 --- /dev/null +++ b/docker-compose/ext-src/prefix-src/regular-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +dropdb --if-exist contrib_regression +createdb contrib_regression +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +${PG_REGRESS} --use-existing --inputdir=./ --bindir='/usr/local/pgsql/bin' --dbname=contrib_regression create_extension prefix falcon explain queries \ No newline at end of file diff --git a/docker-compose/ext-src/rag_bge_small_en_v15-src/Makefile b/docker-compose/ext-src/rag_bge_small_en_v15-src/Makefile index de39cdc367..ac87cc511b 100644 --- a/docker-compose/ext-src/rag_bge_small_en_v15-src/Makefile +++ b/docker-compose/ext-src/rag_bge_small_en_v15-src/Makefile @@ -3,8 +3,13 @@ MODULE_big = rag_bge_small_en_v15 OBJS = $(patsubst %.rs,%.o,$(wildcard src/*.rs)) REGRESS = basic_functions embedding_functions basic_functions_enhanced embedding_functions_enhanced -REGRESS_OPTS = --load-extension=vector --load-extension=rag_bge_small_en_v15 PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) -include $(PGXS) +PG_REGRESS := $(dir $(PGXS))../../src/test/regress/pg_regress +.PHONY installcheck: +installcheck: + dropdb --if-exists contrib_regression + createdb contrib_regression + psql -d contrib_regression -c "CREATE EXTENSION vector" -c "CREATE EXTENSION rag_bge_small_en_v15" + $(PG_REGRESS) --use-existing --dbname=contrib_regression $(REGRESS) \ No newline at end of file diff --git a/docker-compose/ext-src/rag_jina_reranker_v1_tiny_en-src/Makefile b/docker-compose/ext-src/rag_jina_reranker_v1_tiny_en-src/Makefile index 6067debf56..e81f94ef47 100644 --- a/docker-compose/ext-src/rag_jina_reranker_v1_tiny_en-src/Makefile +++ b/docker-compose/ext-src/rag_jina_reranker_v1_tiny_en-src/Makefile @@ -3,8 +3,13 @@ MODULE_big = rag_jina_reranker_v1_tiny_en OBJS = $(patsubst %.rs,%.o,$(wildcard src/*.rs)) REGRESS = reranking_functions reranking_functions_enhanced -REGRESS_OPTS = --load-extension=vector --load-extension=rag_jina_reranker_v1_tiny_en PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) -include $(PGXS) +PG_REGRESS := $(dir $(PGXS))../../src/test/regress/pg_regress +.PHONY installcheck: +installcheck: + dropdb --if-exists contrib_regression + createdb contrib_regression + psql -d contrib_regression -c "CREATE EXTENSION vector" -c "CREATE EXTENSION rag_jina_reranker_v1_tiny_en" + $(PG_REGRESS) --use-existing --dbname=contrib_regression $(REGRESS) diff --git a/docker-compose/ext-src/rum-src/regular-test.sh b/docker-compose/ext-src/rum-src/regular-test.sh new file mode 100755 index 0000000000..d1d45a36ef --- /dev/null +++ b/docker-compose/ext-src/rum-src/regular-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +dropdb --if-exist contrib_regression +createdb contrib_regression +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +${PG_REGRESS} --inputdir=./ --bindir='/usr/local/pgsql/bin' --use-existing --dbname=contrib_regression rum rum_hash ruminv timestamp orderby orderby_hash altorder altorder_hash limits int2 int4 int8 float4 float8 money oid time timetz date interval macaddr inet cidr text varchar char bytea bit varbit numeric rum_weight expr array \ No newline at end of file