diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 00000000..6e448460 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +set -x + +for d in $TOOZ_TEST_URLS +do + TOOZ_TEST_URL=$d $* +done diff --git a/tooz/tests/__init__.py b/tooz/tests/__init__.py index e9491033..c9a0bf70 100644 --- a/tooz/tests/__init__.py +++ b/tooz/tests/__init__.py @@ -56,7 +56,7 @@ class TestWithCoordinator(testcase.TestCase): def setUp(self): super(TestWithCoordinator, self).setUp() if self.url is None: - self.skipTest("No URL set for this driver") + raise RuntimeError("No URL set for this driver") self.useFixture(fixtures.NestedTempfile()) self.group_id = get_random_uuid() self.member_id = get_random_uuid() diff --git a/tooz/tests/test_coordination.py b/tooz/tests/test_coordination.py index c177100a..611aa89c 100644 --- a/tooz/tests/test_coordination.py +++ b/tooz/tests/test_coordination.py @@ -978,18 +978,6 @@ class TestAPI(tests.TestWithCoordinator): self.assertTrue(lock.release()) -class ZakeTestAPI(TestAPI): - url = "zake://" - - -class IPCTestAPI(TestAPI): - url = "ipc://" - - -class FileTestAPI(TestAPI): - url = "file:///tmp" - - class TestHook(testcase.TestCase): def setUp(self): super(TestHook, self).setUp() diff --git a/tox.ini b/tox.ini index f98080a0..40c0c981 100644 --- a/tox.ini +++ b/tox.ini @@ -14,18 +14,18 @@ deps = .[test,zake,ipc,memcached,mysql,etcd] mysql: .[mysql] etcd: .[etcd] consul: .[consul] +setenv = + TOOZ_TEST_URLS = file:///tmp zake:// ipc:// # NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt -commands = {toxinidir}/tools/pretty_tox.sh "{posargs}" +commands = + {toxinidir}/run-tests.sh {toxinidir}/tools/pretty_tox.sh "{posargs}" + {toxinidir}/run-examples.sh [testenv:venv] # This target is used by the gate go run Sphinx to build the doc deps = .[doc] commands = {posargs} -[testenv:py27] -commands = {toxinidir}/tools/pretty_tox.sh "{posargs}" - {toxinidir}/run-examples.sh - [testenv:py27-zookeeper] commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}"