Merge "Replace overtest by pifpaf"

This commit is contained in:
Jenkins 2016-05-30 03:26:55 +00:00 committed by Gerrit Code Review
commit 60a2601c98
5 changed files with 20 additions and 23 deletions

View File

@ -132,9 +132,8 @@ class TestBase(test_base.BaseTestCase):
super(TestBase, self).setUp()
db_url = os.environ.get(
'AODH_TEST_STORAGE_URL',
os.environ.get(
"OVERTEST_URL", 'sqlite://').replace(
"mysql://", "mysql+pymysql://"))
'sqlite://').replace(
"mysql://", "mysql+pymysql://")
engine = urlparse.urlparse(db_url).scheme
# In case some drivers have additional specification, for example:
# PyMySQL will have scheme mysql+pymysql.

View File

@ -42,10 +42,8 @@ class ConfigFixture(fixture.GabbiFixture):
# Determine the database connection.
db_url = os.environ.get(
'AODH_TEST_STORAGE_URL',
os.environ.get(
"OVERTEST_URL", 'sqlite://').replace(
"mysql://", "mysql+pymysql://"))
'AODH_TEST_STORAGE_URL', "").replace(
"mysql://", "mysql+pymysql://")
if not db_url:
raise case.SkipTest('No database connection configured')
@ -78,7 +76,9 @@ class ConfigFixture(fixture.GabbiFixture):
conf.set_override('pecan_debug', True, group='api',
enforce_type=True)
parsed_url = list(urlparse.urlparse(db_url))
parsed_url = urlparse.urlparse(db_url)
if parsed_url.scheme != 'sqlite':
parsed_url = list(parsed_url)
parsed_url[2] += '-%s' % str(uuid.uuid4()).replace('-', '')
db_url = urlparse.urlunparse(parsed_url)

View File

@ -6,11 +6,9 @@ export AODH_SERVICE_URL=${AODH_SERVICE_URL:-http://127.0.0.1:8042}
case $AODH_TEST_BACKEND in
hbase)
export AODH_TEST_STORAGE_URL="hbase://__test__"
AODH_TEST_STORAGE_URL="hbase://__test__" $*
;;
*)
source $(which overtest) $AODH_TEST_BACKEND
pifpaf -g AODH_TEST_STORAGE_URL run $AODH_TEST_BACKEND -- $*
;;
esac
$*

View File

@ -58,7 +58,7 @@ doc =
sphinxcontrib-pecanwsme>=0.8
test =
overtest>=0.7.0
pifpaf>=0.1.0
oslotest>=1.5.1 # Apache-2.0
coverage>=3.6
fixtures>=1.3.1

16
tox.ini
View File

@ -24,19 +24,19 @@ setenv = OS_TEST_PATH=aodh/tests/functional/
deps = .[mongodb,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands =
overtest mongodb python setup.py testr --slowest --testr-args="{posargs}"
pifpaf -g AODH_TEST_STORAGE_URL run mongodb -- python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py27-mysql]
deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands =
overtest mysql python setup.py testr --slowest --testr-args="{posargs}"
pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --slowest --testr-args="{posargs}"
[testenv:py27-pgsql]
deps = .[postgresql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands =
overtest postgresql python setup.py testr --slowest --testr-args="{posargs}"
pifpaf -g AODH_TEST_STORAGE_URL run postgresql -- python setup.py testr --slowest --testr-args="{posargs}"
[testenv:functional]
deps = .[mysql,postgresql,mongodb,hbase,test]
@ -55,10 +55,10 @@ commands =
deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/gabbi
commands =
overtest mysql python setup.py testr --testr-args="{posargs}"
pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --testr-args="{posargs}"
[testenv:cover]
commands = overtest mysql python setup.py testr --slowest --coverage --testr-args="{posargs}"
commands = pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --slowest --coverage --testr-args="{posargs}"
[testenv:pep8]
deps = hacking<0.12,>=0.11.0
@ -90,17 +90,17 @@ commands = bash -x oslo_debug_helper {posargs}
[testenv:debug-mongodb]
deps = .[mongodb,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands = overtest mongodb oslo_debug_helper {posargs}
commands = pifpaf -g AODH_TEST_STORAGE_URL run mongodb -- oslo_debug_helper {posargs}
[testenv:debug-mysql]
deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands = overtest mysql oslo_debug_helper {posargs}
commands = pifpaf -g AODH_TEST_STORAGE_URL run mysql -- oslo_debug_helper {posargs}
[testenv:debug-pgsql]
deps = .[postgresql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands = overtest postgresql oslo_debug_helper {posargs}
commands = pifpaf -g AODH_TEST_STORAGE_URL run postgresql -- oslo_debug_helper {posargs}
[flake8]
ignore =