summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2017-06-08 10:28:22 +0200
committerJulien Danjou <julien@danjou.info>2017-06-09 18:09:31 +0200
commit6d1e1b55cbd3dc3e522b6210fd5dfd861ca00fab (patch)
treebbcc1ef77fdfb81562a99d9c23f5e59aef42a5ac
parent0fa14dd60e331c4053e0574b102b187d66b3cdf4 (diff)
downloadtooz-6d1e1b55cbd3dc3e522b6210fd5dfd861ca00fab.tar.gz
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
-rwxr-xr-xrun-tests.sh24
-rw-r--r--tox.ini82
2 files changed, 31 insertions, 75 deletions
diff --git a/run-tests.sh b/run-tests.sh
index 6e44846..56fa755 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -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
diff --git a/tox.ini b/tox.ini
index 3a126e6..cb6d295 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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}"