mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 19:13:16 +08:00
Tests are now run on a temporary Postgres instance, which is launched by the `pg_regress` test runner. This allows running tests without having an existing running instance with a matching configuration and also obviates the need for preloading the TimescaleDB extension. As a result, tests are simpler to setup and run, and are more reliable and consistent.
24 lines
638 B
Bash
Executable File
24 lines
638 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -u
|
|
set -e
|
|
|
|
PG_REGRESS_PSQL=$1
|
|
PSQL=${PSQL:-$PG_REGRESS_PSQL}
|
|
TEST_PGUSER=${TEST_PGUSER:-postgres}
|
|
TEST_TABLESPACE_PATH=${TEST_TABLESPACE_PATH:-/tmp/tspace1}
|
|
|
|
shift
|
|
|
|
# Setup directories required by tests
|
|
cd test/sql
|
|
mkdir -p ${TEST_TABLESPACE_PATH}
|
|
mkdir -p dump
|
|
|
|
# Hack to grant TEST_PGUSER superuser status so that we can
|
|
# consistently run tests using the same user rather than the
|
|
# current/local user
|
|
${PSQL} $@ -v ECHO=none -c "ALTER USER ${TEST_PGUSER} WITH SUPERUSER;"
|
|
|
|
exec ${PSQL} -U ${TEST_PGUSER} -v ON_ERROR_STOP=1 -v VERBOSITY=terse -v ECHO=all -v TEST_TABLESPACE_PATH=\'${TEST_TABLESPACE_PATH}\' $@
|