timescaledb/test/runner.sh
Erik Nordström d17976538b Run tests on temp Postgres instance
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.
2017-06-01 17:22:37 +02:00

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}\' $@