mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
Configure Travis to test replication
This commit is contained in:
parent
b73115ac41
commit
874705db42
|
@ -23,10 +23,27 @@ create () {
|
|||
dbname=psycopg2_test
|
||||
|
||||
pg_createcluster -p $port --start-conf manual $version psycopg
|
||||
|
||||
# for two-phase commit testing
|
||||
set_param "$version" max_prepared_transactions 10
|
||||
|
||||
# for replication testing
|
||||
set_param "$version" max_wal_senders 5
|
||||
set_param "$version" max_replication_slots 5
|
||||
if [ "$version" == "9.2" -o "$version" == "9.3" ]
|
||||
then
|
||||
set_param "$version" wal_level hot_standby
|
||||
else
|
||||
set_param "$version" wal_level logical
|
||||
fi
|
||||
|
||||
echo "local replication travis trust" \
|
||||
>> "/etc/postgresql/$version/psycopg/pg_hba.conf"
|
||||
|
||||
|
||||
pg_ctlcluster "$version" psycopg start
|
||||
|
||||
sudo -u postgres psql -c "create user travis" "port=$port"
|
||||
sudo -u postgres psql -c "create user travis replication" "port=$port"
|
||||
sudo -u postgres psql -c "create database $dbname" "port=$port"
|
||||
sudo -u postgres psql -c "grant create on database $dbname to travis" "port=$port"
|
||||
sudo -u postgres psql -c "create extension hstore" "port=$port dbname=$dbname"
|
||||
|
|
|
@ -14,11 +14,13 @@ run_test () {
|
|||
export PSYCOPG2_TESTDB=$dbname
|
||||
export PSYCOPG2_TESTDB_PORT=$port
|
||||
export PSYCOPG2_TESTDB_USER=travis
|
||||
make check
|
||||
export PSYCOPG2_TEST_REPL_DSN=
|
||||
|
||||
python -c "from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')" --verbose
|
||||
|
||||
printf "\n\nRunning tests against PostgreSQL $version (green mode)\n\n"
|
||||
export PSYCOPG2_TEST_GREEN=1
|
||||
make check
|
||||
python -c "from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')" --verbose
|
||||
}
|
||||
|
||||
run_test 9.6 54396
|
||||
|
|
Loading…
Reference in New Issue
Block a user