Update travis settings (#581)

* Add master branch and release tags to safelist
* Update build matrix: don't install python3.5 if running acceptance tests
This commit is contained in:
Alexander Kukushkin
2017-12-20 16:28:09 +01:00
committed by GitHub
parent 062c55f99c
commit 84de53603f
+24 -11
View File
@@ -1,19 +1,28 @@
sudo: true sudo: true
dist: trusty dist: trusty
language: python language: python
python:
- "3.5" # 2.7 and 3.6 are preinstalled by default
env: env:
global: global:
- ETCDVERSION=3.0.17 ZKVERSION=3.4.11 CONSULVERSION=0.7.4 - ETCDVERSION=3.0.17 ZKVERSION=3.4.11 CONSULVERSION=0.7.4
- PYVERSIONS="2.7 3.5 3.6" - PYVERSIONS="2.7 3.5 3.6"
- EXCLUDE_BEHAVE="3.5"
- BOTO_CONFIG=/doesnotexist - BOTO_CONFIG=/doesnotexist
matrix: matrix:
- TEST_SUITE="python setup.py" include:
- DCS="etcd" TEST_SUITE="behave" - python: "3.5"
- DCS="exhibitor" TEST_SUITE="behave" env: TEST_SUITE="python setup.py"
- DCS="consul" TEST_SUITE="behave" - python: "3.6"
- DCS="kubernetes" TEST_SUITE="behave" env: DCS="etcd" TEST_SUITE="behave"
- python: "3.6"
env: DCS="exhibitor" TEST_SUITE="behave"
- python: "3.6"
env: DCS="consul" TEST_SUITE="behave"
- python: "3.6"
env: DCS="kubernetes" TEST_SUITE="behave"
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?$/
cache: cache:
directories: directories:
- $HOME/mycache - $HOME/mycache
@@ -21,7 +30,7 @@ before_cache:
- | - |
rm -fr $HOME/mycache/python* rm -fr $HOME/mycache/python*
for pv in $PYVERSIONS; do for pv in $PYVERSIONS; do
if [[ $TEST_SUITE != "behave" || $pv != "3.5" ]]; then if [[ $TEST_SUITE != "behave" || $pv != $EXCLUDE_BEHAVE ]]; then
fpv=$(basename $(readlink $HOME/virtualenv/python${pv})) fpv=$(basename $(readlink $HOME/virtualenv/python${pv}))
mv $HOME/virtualenv/${fpv} $HOME/mycache/${fpv} mv $HOME/virtualenv/${fpv} $HOME/mycache/${fpv}
fi fi
@@ -98,7 +107,7 @@ install:
fi fi
for pv in $PYVERSIONS; do for pv in $PYVERSIONS; do
if [[ $TEST_SUITE != "behave" || $pv != "3.5" ]]; then if [[ $TEST_SUITE != "behave" || $pv != $EXCLUDE_BEHAVE ]]; then
fpv=$(basename $(readlink $HOME/virtualenv/python$pv)) fpv=$(basename $(readlink $HOME/virtualenv/python$pv))
if [[ -d ~/mycache/${fpv} ]]; then if [[ -d ~/mycache/${fpv} ]]; then
mv ~/virtualenv/${fpv} ~/virtualenv/${fpv}.bckp mv ~/virtualenv/${fpv} ~/virtualenv/${fpv}.bckp
@@ -114,13 +123,17 @@ install:
script: script:
- | - |
for pv in $PYVERSIONS; do for pv in $PYVERSIONS; do
if [[ $TEST_SUITE == "behave" && $pv == $EXCLUDE_BEHAVE ]]; then
continue
fi
source ~/virtualenv/python${pv}/bin/activate source ~/virtualenv/python${pv}/bin/activate
if [[ $TEST_SUITE != "behave" ]]; then if [[ $TEST_SUITE != "behave" ]]; then
echo Running unit tests using python${pv} echo Running unit tests using python${pv}
$TEST_SUITE test $TEST_SUITE test
$TEST_SUITE flake8 $TEST_SUITE flake8
elif [[ $pv != "3.5" ]]; then elif [[ $pv != $EXCLUDE_BEHAVE ]]; then
echo Running acceptance tests using python${pv} echo Running acceptance tests using python${pv}
if ! PATH=.:/usr/lib/postgresql/9.6/bin:$PATH $TEST_SUITE; then if ! PATH=.:/usr/lib/postgresql/9.6/bin:$PATH $TEST_SUITE; then
# output all log files when tests are failing # output all log files when tests are failing