Replace overtest by pifpaf

This is new and shiny!

Change-Id: I5ccc576211a0c49b65a07cc4054a2d039bd4d5d5
This commit is contained in:
Julien Danjou 2016-05-19 15:16:54 +02:00
parent 5f94fbc6c0
commit 467a0418c8
5 changed files with 20 additions and 23 deletions

View File

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

View File

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

View File

@ -6,11 +6,9 @@ export AODH_SERVICE_URL=${AODH_SERVICE_URL:-http://127.0.0.1:8042}
case $AODH_TEST_BACKEND in case $AODH_TEST_BACKEND in
hbase) 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 esac
$*

View File

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

16
tox.ini
View File

@ -24,19 +24,19 @@ setenv = OS_TEST_PATH=aodh/tests/functional/
deps = .[mongodb,test] deps = .[mongodb,test]
setenv = OS_TEST_PATH=aodh/tests/functional/ setenv = OS_TEST_PATH=aodh/tests/functional/
commands = 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] [testenv:py27-mysql]
deps = .[mysql,test] deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/ setenv = OS_TEST_PATH=aodh/tests/functional/
commands = 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] [testenv:py27-pgsql]
deps = .[postgresql,test] deps = .[postgresql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/ setenv = OS_TEST_PATH=aodh/tests/functional/
commands = 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] [testenv:functional]
deps = .[mysql,postgresql,mongodb,hbase,test] deps = .[mysql,postgresql,mongodb,hbase,test]
@ -55,10 +55,10 @@ commands =
deps = .[mysql,test] deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/gabbi setenv = OS_TEST_PATH=aodh/tests/functional/gabbi
commands = 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] [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] [testenv:pep8]
deps = hacking<0.12,>=0.11.0 deps = hacking<0.12,>=0.11.0
@ -90,17 +90,17 @@ commands = bash -x oslo_debug_helper {posargs}
[testenv:debug-mongodb] [testenv:debug-mongodb]
deps = .[mongodb,test] deps = .[mongodb,test]
setenv = OS_TEST_PATH=aodh/tests/functional/ 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] [testenv:debug-mysql]
deps = .[mysql,test] deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/ 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] [testenv:debug-pgsql]
deps = .[postgresql,test] deps = .[postgresql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/ 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] [flake8]
ignore = ignore =