From 8f11821c173d723824c537c6b36cb5e7b883149d Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 19 Oct 2019 14:49:27 +0200 Subject: [PATCH] Use travis test config variable 0/1 instead of blank strings Travis web interface doesn't allow anymore to set an empty string as variable value. --- doc/release.rst | 2 +- scripts/travis_prepare.sh | 6 +++--- scripts/travis_test.sh | 8 ++++---- tests/testutils.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/release.rst b/doc/release.rst index 3ea4a9fa..a91c9323 100644 --- a/doc/release.rst +++ b/doc/release.rst @@ -16,7 +16,7 @@ How to make a psycopg2 release $ export VERSION=2.7 - In the `Travis settings`__ you may want to be sure that the variables - ``TEST_PAST`` and ``TEST_FUTURE`` are set to a nonzero string to check all + ``TEST_PAST`` and ``TEST_FUTURE`` are set to 1 to check all the supported postgres version. .. __: https://travis-ci.org/psycopg/psycopg2/settings diff --git a/scripts/travis_prepare.sh b/scripts/travis_prepare.sh index 778ea26c..26644a0d 100755 --- a/scripts/travis_prepare.sh +++ b/scripts/travis_prepare.sh @@ -116,7 +116,7 @@ create () { cd / # Postgres versions supported by Travis CI -if [[ -z "$DONT_TEST_PRESENT" ]]; then +if (( ! "$DONT_TEST_PRESENT" )); then create 10 create 9.6 create 9.5 @@ -125,7 +125,7 @@ fi # Unsupported postgres versions that we still support # Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs -if [[ -n "$TEST_PAST" ]]; then +if (( "$TEST_PAST" )); then create 7.4 create 8.0 create 8.1 @@ -139,6 +139,6 @@ if [[ -n "$TEST_PAST" ]]; then fi # Postgres built from master -if [[ -n "$TEST_FUTURE" ]]; then +if (( "$TEST_FUTURE" )); then create 11 11-master fi diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh index 8ca4e9af..5a5b765a 100755 --- a/scripts/travis_test.sh +++ b/scripts/travis_test.sh @@ -16,7 +16,7 @@ set -e -x run_test () { VERSION=$1 DBNAME=psycopg2_test - if [[ -n "$TEST_VERBOSE" ]]; then + if (( "$TEST_VERBOSE" )); then VERBOSE=--verbose else VERBOSE= @@ -45,7 +45,7 @@ run_test () { } # Postgres versions supported by Travis CI -if [[ -z "$DONT_TEST_PRESENT" ]]; then +if (( ! "$DONT_TEST_PRESENT" )); then run_test 10 run_test 9.6 run_test 9.5 @@ -54,7 +54,7 @@ fi # Unsupported postgres versions that we still support # Images built by https://github.com/psycopg/psycopg2-wheels/tree/build-dinosaurs -if [[ -n "$TEST_PAST" ]]; then +if (( "$TEST_PAST" )); then run_test 9.3 run_test 9.2 run_test 9.1 @@ -68,6 +68,6 @@ if [[ -n "$TEST_PAST" ]]; then fi # Postgres built from master -if [[ -n "$TEST_FUTURE" ]]; then +if (( "$TEST_FUTURE" )); then run_test 11 fi diff --git a/tests/testutils.py b/tests/testutils.py index 996ceb7d..919135f4 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -425,7 +425,7 @@ def slow(f): """ @wraps(f) def slow_(self): - if os.environ.get('PSYCOPG2_TEST_FAST'): + if os.environ.get('PSYCOPG2_TEST_FAST', '0') != '0': return self.skipTest("slow test") return f(self) return slow_