tests: tests fail if no URL is set + run partitioner tests on basic drivers
This makes sure that the test fails if not URL is set. This allows make sure we test the non-coordination tests (e.g. partitioner) with all base drives (zake, ipc, file) by using the TOOZ_TEST_URL to run the tests. Change-Id: Id500636d166e5ebcc54fda16ef128f91f32170d6
This commit is contained in:
parent
85fbf6ca3c
commit
afba8d3c22
8
run-tests.sh
Executable file
8
run-tests.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
for d in $TOOZ_TEST_URLS
|
||||||
|
do
|
||||||
|
TOOZ_TEST_URL=$d $*
|
||||||
|
done
|
@ -56,7 +56,7 @@ class TestWithCoordinator(testcase.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestWithCoordinator, self).setUp()
|
super(TestWithCoordinator, self).setUp()
|
||||||
if self.url is None:
|
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.useFixture(fixtures.NestedTempfile())
|
||||||
self.group_id = get_random_uuid()
|
self.group_id = get_random_uuid()
|
||||||
self.member_id = get_random_uuid()
|
self.member_id = get_random_uuid()
|
||||||
|
@ -978,18 +978,6 @@ class TestAPI(tests.TestWithCoordinator):
|
|||||||
self.assertTrue(lock.release())
|
self.assertTrue(lock.release())
|
||||||
|
|
||||||
|
|
||||||
class ZakeTestAPI(TestAPI):
|
|
||||||
url = "zake://"
|
|
||||||
|
|
||||||
|
|
||||||
class IPCTestAPI(TestAPI):
|
|
||||||
url = "ipc://"
|
|
||||||
|
|
||||||
|
|
||||||
class FileTestAPI(TestAPI):
|
|
||||||
url = "file:///tmp"
|
|
||||||
|
|
||||||
|
|
||||||
class TestHook(testcase.TestCase):
|
class TestHook(testcase.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestHook, self).setUp()
|
super(TestHook, self).setUp()
|
||||||
|
10
tox.ini
10
tox.ini
@ -14,18 +14,18 @@ deps = .[test,zake,ipc,memcached,mysql,etcd]
|
|||||||
mysql: .[mysql]
|
mysql: .[mysql]
|
||||||
etcd: .[etcd]
|
etcd: .[etcd]
|
||||||
consul: .[consul]
|
consul: .[consul]
|
||||||
|
setenv =
|
||||||
|
TOOZ_TEST_URLS = file:///tmp zake:// ipc://
|
||||||
# NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt
|
# 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]
|
[testenv:venv]
|
||||||
# This target is used by the gate go run Sphinx to build the doc
|
# This target is used by the gate go run Sphinx to build the doc
|
||||||
deps = .[doc]
|
deps = .[doc]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:py27]
|
|
||||||
commands = {toxinidir}/tools/pretty_tox.sh "{posargs}"
|
|
||||||
{toxinidir}/run-examples.sh
|
|
||||||
|
|
||||||
[testenv:py27-zookeeper]
|
[testenv:py27-zookeeper]
|
||||||
commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
|
commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user