#!/bin/sh

set -e

pg_ctlcluster 13 main start

# Disable the mysql test suite for now, we only run the postgres test suite
# The limitation is that both database engines run (as one would expect) as
# different users and therefore local identification via the uid works either
# for one or the other, so the case hereunder is executed against postgres with
# the postgres user and in that execution the mysql test cases could not be run
# without further changes to the test_databases.ini file and to the default
# mysql setup.
sed -i '/mysql/d' test_databases.ini

export PYTHONPATH=$(pwd)/debian/tests

runuser -u postgres -- psql -c 'create database yoyo_test;'
runuser -u postgres -w PYTHONPATH -- pytest-3 yoyo/tests
