Simplify env list and test running

This should make it easy to run any Python version test, e.g. Python 3.6,
without any further change.

Change-Id: I91a47b736371549e50b7c7fd60e46e0f87c357ae
This commit is contained in:
Julien Danjou 2017-06-08 10:28:22 +02:00
parent 0fa14dd60e
commit 6d1e1b55cb
2 changed files with 31 additions and 75 deletions

View File

@ -1,8 +1,22 @@
#!/bin/sh
#!/bin/bash
set -e
set -x
for d in $TOOZ_TEST_URLS
do
TOOZ_TEST_URL=$d $*
done
if [ -n "$TOOZ_TEST_DRIVERS" ]
then
IFS=","
for TOOZ_TEST_DRIVER in $TOOZ_TEST_DRIVERS
do
IFS=" "
TOOZ_TEST_DRIVER=(${TOOZ_TEST_DRIVER})
SETUP_ENV_SCRIPT="./setup-${TOOZ_TEST_DRIVER[0]}-env.sh"
[ -x $SETUP_ENV_SCRIPT ] || unset SETUP_ENV_SCRIPT
$SETUP_ENV_SCRIPT pifpaf -e TOOZ_TEST run "${TOOZ_TEST_DRIVER[@]}" -- $*
done
unset IFS
else
for d in $TOOZ_TEST_URLS
do
TOOZ_TEST_URL=$d $*
done
fi

82
tox.ini
View File

@ -18,6 +18,18 @@ deps = .[test,zake,ipc,memcached,mysql,etcd,etcd3,etcd3gw]
consul: .[consul]
setenv =
TOOZ_TEST_URLS = file:///tmp zake:// ipc://
zookeeper: TOOZ_TEST_DRIVERS = zookeeper
redis: TOOZ_TEST_DRIVERS = redis
sentinel: TOOZ_TEST_DRIVERS = redis --sentinel
memcached: TOOZ_TEST_DRIVERS = memcached
mysql: TOOZ_TEST_DRIVERS = mysql
postgresql: TOOZ_TEST_DRIVERS = postgresql
etcd: TOOZ_TEST_DRIVERS = etcd,etcd --cluster
etcd3: TOOZ_TEST_DRIVERS = etcd
etcd3: TOOZ_TEST_ETCD3 = 1
etcd3gw: TOOZ_TEST_DRIVERS = etcd
etcd3gw: TOOZ_TEST_ETCD3GW = 1
consul: TOOZ_TEST_DRIVERS = consul
# NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt
commands =
{toxinidir}/run-tests.sh {toxinidir}/tools/pretty_tox.sh "{posargs}"
@ -28,76 +40,6 @@ commands =
deps = .[doc]
commands = {posargs}
[testenv:py27-zookeeper]
commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-zookeeper]
commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-redis]
commands = pifpaf -e TOOZ_TEST run redis -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-redis]
commands = pifpaf -e TOOZ_TEST run redis -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-sentinel]
commands = pifpaf -e TOOZ_TEST run redis --sentinel -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-sentinel]
commands = pifpaf -e TOOZ_TEST run redis --sentinel -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-memcached]
commands = pifpaf -e TOOZ_TEST run memcached -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-memcached]
commands = pifpaf -e TOOZ_TEST run memcached -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-postgresql]
commands = pifpaf -e TOOZ_TEST run postgresql -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-postgresql]
commands = pifpaf -e TOOZ_TEST run postgresql -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-mysql]
commands = pifpaf -e TOOZ_TEST run mysql -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-mysql]
commands = pifpaf -e TOOZ_TEST run mysql -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-etcd]
commands = {toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
{toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-etcd]
commands = {toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
{toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-etcd3]
setenv = TOOZ_TEST_ETCD3=1
commands = {toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
{toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-etcd3]
setenv = TOOZ_TEST_ETCD3=1
commands = {toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
{toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-etcd3gw]
setenv = TOOZ_TEST_ETCD3GW=1
commands = {toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
{toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-etcd3gw]
setenv = TOOZ_TEST_ETCD3GW=1
commands = {toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
{toxinidir}/setup-etcd-env.sh pifpaf -e TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py27-consul]
commands = {toxinidir}/setup-consul-env.sh pifpaf -e TOOZ_TEST run consul -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:py35-consul]
commands = {toxinidir}/setup-consul-env.sh pifpaf -e TOOZ_TEST run consul -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
[testenv:cover]
commands = python setup.py testr --slowest --coverage --testr-args="{posargs}"