tests: do not skip test on connection error

Change-Id: I50973f8c1dfc2f4ec9b5847784085a0f163845e2
This commit is contained in:
Julien Danjou 2014-12-01 14:20:09 +01:00
parent ffd48fbfad
commit 910188e2f8
4 changed files with 12 additions and 10 deletions

View File

@ -19,9 +19,11 @@ if ! check_port 11211; then
if [ -n "$memcached_bin" ]; then
$memcached_bin &
else
echo "Memcached server not available, testing being skipped..."
echo "Memcached server not available"
exit 1
fi
fi
export TOOZ_TEST_MEMCACHED_URL="memcached://?timeout=5"
# Yield execution to venv command
$*

View File

@ -19,9 +19,11 @@ if ! check_port 6379; then
if [ -n "$redis_bin" ]; then
$redis_bin --port 6379 &
else
echo "Redis server not available, testing being skipped..."
echo "Redis server not available"
exit 1
fi
fi
export TOOZ_TEST_REDIS_URL="redis://localhost:6379?timeout=5"
# Yield execution to venv command
$*

View File

@ -52,5 +52,6 @@ if ! check_port 2181 && [ -d $ZOO_CONF ]; then
fi
fi
export TOOZ_TEST_ZOOKEEPER_URL="kazoo://127.0.0.1:2181?timeout=5"
# Yield execution to venv command
$*

View File

@ -29,13 +29,13 @@ class TestAPI(testscenarios.TestWithScenarios,
tests.TestCaseSkipNotImplemented):
scenarios = [
('zookeeper', {'url': 'kazoo://127.0.0.1:2181?timeout=5',
'bad_url': 'kazoo://localhost:1'}),
('kazoo', {'url': os.getenv("TOOZ_TEST_ZOOKEEPER_URL"),
'bad_url': 'kazoo://localhost:1'}),
('zake', {'url': 'zake://?timeout=5'}),
('memcached', {'url': 'memcached://?timeout=5',
('memcached', {'url': os.getenv("TOOZ_TEST_MEMCACHED_URL"),
'bad_url': 'memcached://localhost:1'}),
('ipc', {'url': 'ipc://'}),
('redis', {'url': 'redis://localhost:6379?timeout=5',
('redis', {'url': os.getenv("TOOZ_TEST_REDIS_URL"),
'bad_url': 'redis://localhost:1'}),
('postgresql', {'url': os.getenv("TOOZ_TEST_PGSQL_URL"),
'bad_url': 'postgresql://localhost:1'}),
@ -75,10 +75,7 @@ class TestAPI(testscenarios.TestWithScenarios,
self.member_id = self._get_random_uuid()
self._coord = tooz.coordination.get_coordinator(self.url,
self.member_id)
try:
self._coord.start()
except tooz.coordination.ToozConnectionError as e:
raise testcase.TestSkipped(str(e))
self._coord.start()
def tearDown(self):
self._coord.stop()