diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2018-10-23 01:55:31 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2018-10-23 12:52:12 +0100 |
commit | e0b833edcd06e9d850222ffc8a194bf3785fb8f6 (patch) | |
tree | 5054e7f805e4f4b7ff55afe0c8fbbdc893bf4353 | |
parent | 1de7d53fb1cc0163f24e2b8bcf3e6bab0e1072d4 (diff) | |
download | psycopg2-e0b833edcd06e9d850222ffc8a194bf3785fb8f6.tar.gz |
Test PostgreSQL 11 on Travistest-pg-11
-rwxr-xr-x | scripts/travis_prepare.sh | 22 | ||||
-rwxr-xr-x | scripts/travis_test.sh | 3 |
2 files changed, 20 insertions, 5 deletions
diff --git a/scripts/travis_prepare.sh b/scripts/travis_prepare.sh index 73cbb84..4da582d 100755 --- a/scripts/travis_prepare.sh +++ b/scripts/travis_prepare.sh @@ -35,14 +35,24 @@ create () { export DATADIR="/var/lib/postgresql/$PACKAGE/psycopg" export PGDIR="/usr/lib/postgresql/$PACKAGE" - export PGBIN="$PGDIR/bin" - # install postgres versions not available on the image - if (( "$VERNUM" < 902 || "$VERNUM" > 906 )); then + # for investigation, if needed + # ls -l /etc/apt/sources.list.d/ + # cat /etc/apt/sources.list.d/pgdg.list || true + # ls -l /usr/lib/postgresql/ + + # In this moment, the image offers 9.2 to 9.6, pgdg has 9.3 to 11 + if (( "$VERNUM" >= 1000 && "$VERNUM" <= 1100 )); then + apt-get update + apt-get install -y \ + postgresql-${VERSION} postgresql-server-dev-${VERSION} + + elif (( "$VERNUM" < 902 || "$VERNUM" > 1100 )); then wget -O - http://initd.org/psycopg/upload/postgresql/postgresql-${PACKAGE}.tar.bz2 \ | sudo tar xjf - -C /usr/lib/postgresql fi + export PGBIN="$PGDIR/bin" sudo -u postgres "$PGBIN/initdb" -D "$DATADIR" set_param port "$PORT" @@ -103,8 +113,12 @@ create () { # Would give a permission denied error in the travis build dir cd / +# Stop host-wide postgres otherwise installing other versions from pgdg fails +service postgresql stop + # Postgres versions supported by Travis CI if [[ -z "$DONT_TEST_PRESENT" ]]; then + create 11 create 10 create 9.6 create 9.5 @@ -128,5 +142,5 @@ fi # Postgres built from master if [[ -n "$TEST_FUTURE" ]]; then - create 11 11-master + create 12 12-master fi diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh index 91c8b5f..df2e095 100755 --- a/scripts/travis_test.sh +++ b/scripts/travis_test.sh @@ -46,6 +46,7 @@ run_test () { # Postgres versions supported by Travis CI if [[ -z "$DONT_TEST_PRESENT" ]]; then + run_test 11 run_test 10 run_test 9.6 run_test 9.5 @@ -69,5 +70,5 @@ fi # Postgres built from master if [[ -n "$TEST_FUTURE" ]]; then - run_test 11 + run_test 12 fi |