diff --git a/docker-compose/ext-src/hll-src/regular-test.sh b/docker-compose/ext-src/hll-src/regular-test.sh new file mode 100755 index 0000000000..ac6d1b78cd --- /dev/null +++ b/docker-compose/ext-src/hll-src/regular-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +dropdb --if-exists contrib_regression +createdb contrib_regression +${PG_REGRESS} --use-existing --inputdir=./ --bindir='/usr/local/pgsql/bin' --dbname=contrib_regression setup add_agg agg_oob auto_sparse card_op cast_shape copy_binary cumulative_add_cardinality_correction cumulative_add_comprehensive_promotion cumulative_add_sparse_edge cumulative_add_sparse_random cumulative_add_sparse_step cumulative_union_comprehensive cumulative_union_explicit_explicit cumulative_union_explicit_promotion cumulative_union_probabilistic_probabilistic cumulative_union_sparse_full_representation cumulative_union_sparse_promotion cumulative_union_sparse_sparse disable_hashagg equal explicit_thresh hash hash_any meta_func murmur_bigint murmur_bytea nosparse notequal scalar_oob storedproc transaction typmod typmod_insert union_op \ No newline at end of file diff --git a/docker-compose/ext-src/hypopg-src/regular-test.sh b/docker-compose/ext-src/hypopg-src/regular-test.sh new file mode 100755 index 0000000000..ad2eafb66e --- /dev/null +++ b/docker-compose/ext-src/hypopg-src/regular-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +dropdb --if-exists 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 --inputdir=test --dbname=contrib_regression hypopg hypo_brin hypo_index_part hypo_include hypo_hash hypo_hide_index \ No newline at end of file diff --git a/docker-compose/ext-src/ip4r-src/regular-test.sh b/docker-compose/ext-src/ip4r-src/regular-test.sh new file mode 100755 index 0000000000..019bf3ada1 --- /dev/null +++ b/docker-compose/ext-src/ip4r-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 ip4r ip4r-softerr ip4r-v11 \ No newline at end of file diff --git a/docker-compose/ext-src/pg_cron-src/regular-test.sh b/docker-compose/ext-src/pg_cron-src/regular-test.sh new file mode 100755 index 0000000000..7ddd26693d --- /dev/null +++ b/docker-compose/ext-src/pg_cron-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 pg_cron-test \ No newline at end of file diff --git a/docker-compose/ext-src/pg_graphql-src/regular-test.sh b/docker-compose/ext-src/pg_graphql-src/regular-test.sh new file mode 100755 index 0000000000..10eeda98c1 --- /dev/null +++ b/docker-compose/ext-src/pg_graphql-src/regular-test.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -ex +cd "$(dirname "${0}")" +dropdb --if-exists contrib_regression +createdb contrib_regression +PGXS="$(dirname "$(pg_config --pgxs)" )" +REGRESS="${PGXS}/../test/regress/pg_regress" +TESTDIR="test" +TESTS=$(ls "${TESTDIR}/sql" | sort ) +TESTS=${TESTS//\.sql/} +TESTS=${TESTS/empty_mutations/} +dropdb --if-exist contrib_regression +createdb contrib_regression +psql -v ON_ERROR_STOP=1 -f test/fixtures.sql -d contrib_regression +${REGRESS} --use-existing --dbname=contrib_regression --inputdir=${TESTDIR} ${TESTS} + diff --git a/docker-compose/ext-src/pg_hint_plan-src/regular-test.sh b/docker-compose/ext-src/pg_hint_plan-src/regular-test.sh new file mode 100755 index 0000000000..f789b28aca --- /dev/null +++ b/docker-compose/ext-src/pg_hint_plan-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' --encoding=UTF8 --dbname=contrib_regression init base_plan pg_hint_plan ut-init ut-A ut-S ut-J ut-L ut-G ut-R ut-fdw ut-W ut-T ut-fini hints_anywhere plpgsql oldextversions \ No newline at end of file diff --git a/docker-compose/ext-src/pg_ivm-src/regular-test.sh b/docker-compose/ext-src/pg_ivm-src/regular-test.sh new file mode 100755 index 0000000000..09935c1201 --- /dev/null +++ b/docker-compose/ext-src/pg_ivm-src/regular-test.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -ex +dropdb --if-exist contrib_regression +createdb contrib_regression +cd "$(dirname ${0})" +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +${PG_REGRESS} --use-existing --inputdir=./ --bindir='/usr/local/pgsql/bin' --dbname=contrib_regression pg_ivm create_immv refresh_immv \ No newline at end of file diff --git a/docker-compose/ext-src/pg_roaringbitmap-src/regular-test.sh b/docker-compose/ext-src/pg_roaringbitmap-src/regular-test.sh new file mode 100755 index 0000000000..09502765f3 --- /dev/null +++ b/docker-compose/ext-src/pg_roaringbitmap-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 roaringbitmap \ No newline at end of file diff --git a/docker-compose/ext-src/pg_semver-src/regular-test.sh b/docker-compose/ext-src/pg_semver-src/regular-test.sh new file mode 100755 index 0000000000..3a77498db4 --- /dev/null +++ b/docker-compose/ext-src/pg_semver-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' --inputdir=test --dbname=contrib_regression base corpus \ No newline at end of file diff --git a/docker-compose/ext-src/pg_tiktoken-src/Makefile b/docker-compose/ext-src/pg_tiktoken-src/Makefile index e23166554a..58407391db 100644 --- a/docker-compose/ext-src/pg_tiktoken-src/Makefile +++ b/docker-compose/ext-src/pg_tiktoken-src/Makefile @@ -5,4 +5,6 @@ REGRESS = pg_tiktoken installcheck: regression-test regression-test: - $(PG_REGRESS) --inputdir=. --outputdir=. --dbname=contrib_regression $(REGRESS) \ No newline at end of file + dropdb --if-exists contrib_regression + createdb contrib_regression + $(PG_REGRESS) --inputdir=. --outputdir=. --use-existing --dbname=contrib_regression $(REGRESS) \ No newline at end of file diff --git a/docker-compose/ext-src/pg_uuidv7-src/regular-test.sh b/docker-compose/ext-src/pg_uuidv7-src/regular-test.sh new file mode 100755 index 0000000000..0de51b854d --- /dev/null +++ b/docker-compose/ext-src/pg_uuidv7-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' --inputdir=test --dbname=contrib_regression 001_setup 002_uuid_generate_v7 003_uuid_v7_to_timestamptz 004_uuid_timestamptz_to_v7 005_uuid_v7_to_timestamp 006_uuid_timestamp_to_v7 \ No newline at end of file diff --git a/docker-compose/ext-src/pgjwt-src/neon-test.sh b/docker-compose/ext-src/pgjwt-src/neon-test.sh index 95af0be77b..64aa41263f 100755 --- a/docker-compose/ext-src/pgjwt-src/neon-test.sh +++ b/docker-compose/ext-src/pgjwt-src/neon-test.sh @@ -1,4 +1,6 @@ #!/bin/bash set -ex cd "$(dirname "${0}")" -pg_prove test.sql \ No newline at end of file +dropdb --if-exists contrib_regression +createdb contrib_regression +pg_prove -d contrib_regression test.sql \ No newline at end of file diff --git a/docker-compose/ext-src/pgrag-src/regular-test.sh b/docker-compose/ext-src/pgrag-src/regular-test.sh new file mode 100755 index 0000000000..6cb1b049a4 --- /dev/null +++ b/docker-compose/ext-src/pgrag-src/regular-test.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -ex +cd "$(dirname "${0}")" +dropdb --if-exist contrib_regression +createdb contrib_regression +psql -d contrib_regression -c "CREATE EXTENSION vector" -c "CREATE EXTENSION rag" +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +${PG_REGRESS} --inputdir=./ --bindir='/usr/local/pgsql/bin' --use-existing --load-extension=vector --load-extension=rag --dbname=contrib_regression basic_functions text_processing api_keys chunking_functions document_processing embedding_api_functions voyageai_functions diff --git a/docker-compose/ext-src/pgvector-src/regular-test.sh b/docker-compose/ext-src/pgvector-src/regular-test.sh new file mode 100755 index 0000000000..81ebd9207d --- /dev/null +++ b/docker-compose/ext-src/pgvector-src/regular-test.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -ex +cd "$(dirname ${0})" +dropdb --if-exist contrib_regression +createdb contrib_regression +psql -d contrib_regression -c "CREATE EXTENSION vector" +PG_REGRESS=$(dirname "$(pg_config --pgxs)")/../test/regress/pg_regress +${PG_REGRESS} --inputdir=./ --bindir='/usr/local/pgsql/bin' --inputdir=test --use-existing --dbname=contrib_regression bit btree cast copy halfvec hnsw_bit hnsw_halfvec hnsw_sparsevec hnsw_vector ivfflat_bit ivfflat_halfvec ivfflat_vector sparsevec vector_type \ No newline at end of file diff --git a/docker-compose/ext-src/pgx_ulid-src/Makefile b/docker-compose/ext-src/pgx_ulid-src/Makefile index 91aceef906..582c3b6557 100644 --- a/docker-compose/ext-src/pgx_ulid-src/Makefile +++ b/docker-compose/ext-src/pgx_ulid-src/Makefile @@ -4,13 +4,20 @@ 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_MAJOR_VERSION := $(word 2, $(subst ., , $(shell $(PG_CONFIG) --version))) ifeq ($(shell test $(PG_MAJOR_VERSION) -lt 17; echo $$?),0) - REGRESS_OPTS = --load-extension=ulid REGRESS = 00_ulid_generation 01_ulid_conversions 03_ulid_errors + EXTNAME = ulid else - REGRESS_OPTS = --load-extension=pgx_ulid REGRESS = 00_ulid_generation 01_ulid_conversions 02_ulid_conversions 03_ulid_errors + EXTNAME = pgx_ulid endif -include $(PGXS) +installcheck: regression-test + +regression-test: + dropdb --if-exists contrib_regression + createdb contrib_regression + psql -d contrib_regression -c "CREATE EXTENSION $(EXTNAME)" + $(PG_REGRESS) --inputdir=. --outputdir=. --use-existing --dbname=contrib_regression $(REGRESS) diff --git a/docker-compose/run-tests.sh b/docker-compose/run-tests.sh index 919fb66003..c14f0bf18e 100755 --- a/docker-compose/run-tests.sh +++ b/docker-compose/run-tests.sh @@ -25,6 +25,17 @@ if [[ -v BENCHMARK_CONNSTR ]]; then exit 1 fi fi +REGULAR_USER=false +while getopts r arg; do + case $arg in + r) + REGULAR_USER=true + shift $((OPTIND-1)) + ;; + *) : + ;; + esac +done extdir=${1} @@ -37,6 +48,11 @@ for d in ${LIST}; do FAILED="${d} ${FAILED}" break fi + if [[ ${REGULAR_USER} = true ]] && [ -f "${d}"/regular-test.sh ]; then + "${d}/regular-test.sh" || FAILED="${d} ${FAILED}" + continue + fi + if [ -f "${d}/neon-test.sh" ]; then "${d}/neon-test.sh" || FAILED="${d} ${FAILED}" else