summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-24 04:42:07 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-24 04:42:55 +0100
commitfeebc8f68991fc1e84ac4fefb9cea0c373eea6db (patch)
treefb4c90f6ce24e1c6e8165855615632e279f199a6 /scripts
parent1463bdb86d46d2d729bf0663443d765ac975f100 (diff)
downloadpsycopg2-feebc8f68991fc1e84ac4fefb9cea0c373eea6db.tar.gz
Don't use separate databases for tests
I got this wrong: I thought parallel test ran in the same VM; they are isolated instead.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/travis_prepare.sh8
-rwxr-xr-xscripts/travis_test.sh13
2 files changed, 6 insertions, 15 deletions
diff --git a/scripts/travis_prepare.sh b/scripts/travis_prepare.sh
index 86b85ba..f4e8611 100755
--- a/scripts/travis_prepare.sh
+++ b/scripts/travis_prepare.sh
@@ -20,17 +20,19 @@ set_param () {
create () {
version=$1
port=$2
- dbname=psycopg2_test_$port
+ dbname=psycopg2_test
pg_createcluster -p $port --start-conf manual $version psycopg
set_param "$version" max_prepared_transactions 10
- sed -i "s/local\s*all\s*postgres.*/local all postgres 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 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"
}
+
# Would give a permission denied error in the travis build dir
cd /
diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh
index 3a1bdb2..df9413a 100755
--- a/scripts/travis_test.sh
+++ b/scripts/travis_test.sh
@@ -8,18 +8,7 @@ set -e
run_test () {
version=$1
port=$2
- pyver=$(python -c "import sys; print(''.join(map(str,sys.version_info[:2])))")
- dbname=psycopg_test_$pyver
-
- # Create a database for each python version to allow tests to run in parallel
- psql -c "create database $dbname" \
- "user=postgres port=$port dbname=postgres"
-
- psql -c "grant create on database $dbname to travis" \
- "user=postgres port=$port dbname=postgres"
-
- psql -c "create extension hstore" \
- "user=postgres port=$port dbname=$dbname"
+ dbname=psycopg2_test
printf "\n\nRunning tests against PostgreSQL $version\n\n"
export PSYCOPG2_TESTDB=$dbname