summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2018-09-17 18:14:07 +0000
committerBen Nemec <bnemec@redhat.com>2018-09-18 00:37:30 +0000
commitf5accf53a015d906074dc81b21581bd6f850904f (patch)
tree66650fb06683c2e1f2fa8de911bfecfb7a21f52d
parent19c0a0b4685aa5052bec23c23cc29c6607226ad6 (diff)
downloadtooz-f5accf53a015d906074dc81b21581bd6f850904f.tar.gz
Fix coverage tests
This project needs some special setup before running its tests, and that wasn't happening in the cover tox env. This switches cover to use the same methods for running tests as the regular test envs. Change-Id: Ie4a6543286caa11dc15173679455b2aa2020dc97
-rw-r--r--.coveragerc2
-rw-r--r--tox.ini37
2 files changed, 37 insertions, 2 deletions
diff --git a/.coveragerc b/.coveragerc
index 41e5648..ea29765 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,7 +1,7 @@
[run]
branch = True
source = tooz
-omit = tooz/tests/*,tooz/openstack/*
+omit = tooz/tests/*
[report]
ignore_errors = True
diff --git a/tox.ini b/tox.ini
index 06ffeb0..7554da3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -46,7 +46,42 @@ commands = {posargs}
[testenv:cover]
basepython = python3
-commands = python setup.py testr --slowest --coverage --testr-args="{posargs}"
+# NOTE(bnemec): Unfortunately, referencing testenv deps doesn't work here, so
+# we have to duplicate the entire list.
+# See https://github.com/tox-dev/tox/issues/706
+deps = .[test,zake,ipc,memcached,mysql,etcd,etcd3,etcd3gw]
+ zookeeper: .[zookeeper]
+ redis: .[redis]
+ sentinel: .[redis]
+ memcached: .[memcached]
+ postgresql: .[postgresql]
+ mysql: .[mysql]
+ etcd: .[etcd]
+ etcd3: .[etcd3]
+ etcd3gw: .[etcd3gw]
+ consul: .[consul]
+ coverage
+setenv =
+ PYTHON=coverage run --source tooz --parallel-mode
+ 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
+commands =
+ {toxinidir}/run-tests.sh {toxinidir}/tools/pretty_tox.sh "{posargs}"
+ {toxinidir}/run-examples.sh
+ coverage combine
+ coverage html -d cover
+ coverage xml -o cover/coverage.xml
[testenv:docs]
basepython = python3