aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory P. Smith <gps@google.com>2021-05-11 20:37:28 -0700
committerGitHub <noreply@github.com>2021-05-11 20:37:28 -0700
commit391cbf2ecd7895a7cb11d2ee0e962aec051e71cc (patch)
treefaae3bd2203b05c4935c42416862462da6c21302
parent11593a7e338adcc527f3eb324c21440d566c508d (diff)
downloadportpicker-391cbf2ecd7895a7cb11d2ee0e962aec051e71cc.tar.gz
Travis config update. (#22)
* test on supported Python 3 versions. * switch away from test.sh for CI * drop 2.7. it's EOL.
-rw-r--r--.travis.yml11
-rwxr-xr-xtest.sh28
2 files changed, 25 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index 55e664f..c9383cc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,17 @@
language: python
+python:
+ - "3.6"
+ - "3.7"
+ - "3.8"
+ - "3.9"
os: linux
arch:
- amd64
- ppc64le
dist: focal
+install:
+ - pip install mock
+ - pip install --upgrade .
script:
- - ./test.sh
+ - python src/tests/portpicker_test.py
+ - PYTHONPATH=src python src/tests/portserver_test.py
diff --git a/test.sh b/test.sh
index ab53aa0..cbd0c69 100755
--- a/test.sh
+++ b/test.sh
@@ -1,25 +1,27 @@
#!/bin/sh -ex
-echo 'TESTING under Python 3'
-mkdir -p build/test_envs/python3
-python3 -m venv build/test_envs/python3
-# Without --upgrade pip won't copy local changes over to a new test install
-# unless you've updated the package version number.
-build/test_envs/python3/bin/pip install --upgrade .
-build/test_envs/python3/bin/python3 src/tests/portpicker_test.py
+if which python3 >/dev/null ; then
+ echo 'TESTING under Python 3'
+ mkdir -p build/test_envs/python3
+ python3 -m venv build/test_envs/python3
+ # Without --upgrade pip won't copy local changes over to a new test install
+ # unless you've updated the package version number.
+ build/test_envs/python3/bin/pip install --upgrade pip
+ build/test_envs/python3/bin/pip install --upgrade .
+ build/test_envs/python3/bin/python3 src/tests/portpicker_test.py
-echo 'TESTING the portserver'
-PYTHONPATH=src build/test_envs/python3/bin/python3 src/tests/portserver_test.py
+ echo 'TESTING the portserver'
+ PYTHONPATH=src build/test_envs/python3/bin/python3 src/tests/portserver_test.py
+fi
if which python2.7 >/dev/null ; then
-echo 'TESTING under Python 2.7'
-mkdir -p build/test_envs/python2
+ echo 'TESTING under Python 2.7'
+ mkdir -p build/test_envs/python2
virtualenv --python=python2.7 build/test_envs/python2
build/test_envs/python2/bin/pip install mock
+ build/test_envs/python2/bin/pip install --upgrade pip
build/test_envs/python2/bin/pip install --upgrade .
build/test_envs/python2/bin/python2 src/tests/portpicker_test.py
-else
- echo 'Python 2.7 not found, not testing on that obsolete thing...'
fi
echo PASS