mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
49 lines
1.3 KiB
Bash
Executable File
49 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -x
|
|
|
|
if [[ -v BENCHMARK_CONNSTR ]]; then
|
|
uri_no_proto="${BENCHMARK_CONNSTR#postgres://}"
|
|
uri_no_proto="${uri_no_proto#postgresql://}"
|
|
if [[ $uri_no_proto == *\?* ]]; then
|
|
base="${uri_no_proto%%\?*}" # before '?'
|
|
else
|
|
base="$uri_no_proto"
|
|
fi
|
|
if [[ $base =~ ^([^:]+):([^@]+)@([^:/]+):?([0-9]*)/(.+)$ ]]; then
|
|
export PGUSER="${BASH_REMATCH[1]}"
|
|
export PGPASSWORD="${BASH_REMATCH[2]}"
|
|
export PGHOST="${BASH_REMATCH[3]}"
|
|
export PGPORT="${BASH_REMATCH[4]:-5432}"
|
|
export PGDATABASE="${BASH_REMATCH[5]}"
|
|
echo export PGUSER="${BASH_REMATCH[1]}"
|
|
echo export PGPASSWORD="${BASH_REMATCH[2]}"
|
|
echo export PGHOST="${BASH_REMATCH[3]}"
|
|
echo export PGPORT="${BASH_REMATCH[4]:-5432}"
|
|
echo export PGDATABASE="${BASH_REMATCH[5]}"
|
|
else
|
|
echo "Invalid PostgreSQL base URI"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
extdir=${1}
|
|
|
|
cd "${extdir}" || exit 2
|
|
FAILED=
|
|
LIST=$( (echo -e "${SKIP//","/"\n"}"; ls) | sort | uniq -u)
|
|
for d in ${LIST}; do
|
|
[ -d "${d}" ] || continue
|
|
if ! psql -w -c "select 1" >/dev/null; then
|
|
FAILED="${d} ${FAILED}"
|
|
break
|
|
fi
|
|
if [ -f "${d}/neon-test.sh" ]; then
|
|
"${d}/neon-test.sh" || FAILED="${d} ${FAILED}"
|
|
else
|
|
USE_PGXS=1 make -C "${d}" installcheck || FAILED="${d} ${FAILED}"
|
|
fi
|
|
done
|
|
[ -z "${FAILED}" ] && exit 0
|
|
echo "${FAILED}"
|
|
exit 1
|