diff options
-rw-r--r-- | .travis.yml | 5 | ||||
-rwxr-xr-x | scripts/travis_prepare.sh | 8 | ||||
-rwxr-xr-x | scripts/travis_test.sh | 13 |
3 files changed, 8 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml index ef056fa..1041163 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,19 +7,18 @@ language: python python: - 2.7 - 3.6-dev - - 3.5 - 2.6 + - 3.5 - 3.4 - 3.3 - 3.2 install: - python setup.py install + - sudo scripts/travis_prepare.sh script: - - sudo scripts/travis_prepare.sh - scripts/travis_test.sh - notifications: email: false 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 |