Merge "hbase: add functional testing"

This commit is contained in:
Jenkins 2015-11-12 15:09:22 +00:00 committed by Gerrit Code Review
commit 0b1cc7ac8c
2 changed files with 10 additions and 15 deletions

View File

@ -11,8 +11,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
import happybase
from oslo_log import log
from oslo_utils import netutils
@ -33,19 +31,12 @@ class Connection(object):
opts = self._parse_connection_url(url)
if opts['host'] == '__test__':
url = os.environ.get('AODH_TEST_STORAGE_URL')
if url:
# Reparse URL, but from the env variable now
opts = self._parse_connection_url(url)
self.conn_pool = self._get_connection_pool(opts)
else:
# This is a in-memory usage for unit tests
if Connection._memory_instance is None:
LOG.debug('Creating a new in-memory HBase Connection '
'object')
Connection._memory_instance = (hbase_inmemory.
MConnectionPool())
self.conn_pool = Connection._memory_instance
# This is a in-memory usage for unit tests
if Connection._memory_instance is None:
LOG.debug('Creating a new in-memory HBase Connection object')
Connection._memory_instance = (hbase_inmemory.
MConnectionPool())
self.conn_pool = Connection._memory_instance
else:
self.conn_pool = self._get_connection_pool(opts)

View File

@ -20,6 +20,10 @@ whitelist_externals = bash
# set environment variable OS_TEST_PATH=./aodh/tests/functional
# in "py-<backend>" jobs
[testenv:py27-hbase]
setenv = OS_TEST_PATH=aodh/tests/functional/
AODH_TEST_STORAGE_URL=hbase://__test__
[testenv:py27-mongodb]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands =