summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-25 17:49:58 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-25 18:37:26 +0100
commit874705db429de5cc23a20c5e5cb85287c163f037 (patch)
tree6cf764929896966c2f4f3072d6ea7369da77eb29 /scripts
parentb73115ac41559c31fc3a2a3fdb0893046c08d1a5 (diff)
downloadpsycopg2-874705db429de5cc23a20c5e5cb85287c163f037.tar.gz
Configure Travis to test replication
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/travis_prepare.sh19
-rwxr-xr-xscripts/travis_test.sh6
2 files changed, 22 insertions, 3 deletions
diff --git a/scripts/travis_prepare.sh b/scripts/travis_prepare.sh
index f4e8611..2b1e12e 100755
--- a/scripts/travis_prepare.sh
+++ b/scripts/travis_prepare.sh
@@ -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"
diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh
index df9413a..1578308 100755
--- a/scripts/travis_test.sh
+++ b/scripts/travis_test.sh
@@ -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