Merge "tests: simplify tox config"

This commit is contained in:
Jenkins 2017-04-29 17:45:36 +00:00 committed by Gerrit Code Review
commit 1f50d4b9a8
5 changed files with 33 additions and 35 deletions

View File

@ -2877,8 +2877,8 @@ class TestAlarmsCompositeRule(TestAlarmsBase):
expect_errors=True, expect_errors=True,
headers=self.auth_headers) headers=self.auth_headers)
faultstring = ("Invalid input for field/attribute threshold. " faultstring = ("Invalid input for field/attribute threshold. "
"Value: 'False'. Wrong type. Expected '<type '" "Value: 'False'. Wrong type. Expected '%s', got '%s'"
"float'>', got '<type 'bool'>'") % (type(1.0), type(True)))
self.assertEqual(faultstring, self.assertEqual(faultstring,
response.json['error_message']['faultstring']) response.json['error_message']['faultstring'])

5
bindep.txt Normal file
View File

@ -0,0 +1,5 @@
libpq-dev [platform:dpkg]
postgresql [platform:dpkg]
mysql-client [platform:dpkg]
mysql-server [platform:dpkg]
gettext [platform:dpkg]

7
run-tests.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash -x
set -e
AODH_TEST_DRIVERS=${AODH_TEST_DRIVERS:-postgresql}
for indexer in ${AODH_TEST_DRIVERS}
do
pifpaf -g AODH_TEST_STORAGE_URL run $indexer -- ./tools/pretty_tox.sh $*
done

View File

@ -2,7 +2,7 @@
set -o pipefail set -o pipefail
TESTRARGS=$1 TESTRARGS=$*
# --until-failure is not compatible with --subunit see: # --until-failure is not compatible with --subunit see:
# #
@ -10,7 +10,7 @@ TESTRARGS=$1
# #
# this work around exists until that is addressed # this work around exists until that is addressed
if [[ "$TESTARGS" =~ "until-failure" ]]; then if [[ "$TESTARGS" =~ "until-failure" ]]; then
python setup.py testr --slowest --testr-args="$TESTRARGS" ostestr --slowest $TESTRARGS
else else
python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f ostestr --no-pretty --slowest --subunit $TESTRARGS | subunit-trace -f
fi fi

46
tox.ini
View File

@ -1,32 +1,28 @@
[tox] [tox]
minversion = 1.6 minversion = 1.6
skipsdist = True skipsdist = True
envlist = py35,py27,pep8 envlist = py{27,35}{,-mysql,-postgresql,-pgsql},functional,pep8
[testenv] [testenv]
deps = .[test]
# NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt # NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt
install_command = pip install -U {opts} {packages}
usedevelop = True usedevelop = True
setenv = VIRTUAL_ENV={envdir} setenv =
OS_TEST_PATH=aodh/tests/unit AODH_TEST_DRIVERS=postgresql mysql
passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE mysql: AODH_TEST_DRIVERS=mysql
postgresql: AODH_TEST_DRIVERS=postgresql
AODH_TEST_DEPS=postgresql,mysql
mysql: AODH_TEST_DEPS=mysql
postgresql: AODH_TEST_DEPS=postgresql
# TODO(sileht): Remove when infra job are removed
pgsql: AODH_TEST_DRIVERS=postgresql
pgsql: AODH_TEST_DEPS=postgresql
deps = .[test,{env:AODH_TEST_DEPS}]
passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE AODH_TEST_DRIVERS
commands = commands =
python setup.py testr --slowest --testr-args="{posargs}" {toxinidir}/run-tests.sh --black-regex '^aodh\.tests\.tempest\..*$' {posargs}
oslo-config-generator --config-file=etc/aodh/aodh-config-generator.conf oslo-config-generator --config-file=etc/aodh/aodh-config-generator.conf
whitelist_externals = bash
[testenv:py27-mysql]
deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands =
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 =
pifpaf -g AODH_TEST_STORAGE_URL run postgresql -- python setup.py testr --slowest --testr-args="{posargs}"
[testenv:functional] [testenv:functional]
deps = .[mysql,postgresql,test] deps = .[mysql,postgresql,test]
@ -37,16 +33,6 @@ passenv = {[testenv]passenv} AODH_*
commands = commands =
{toxinidir}/run-functional-tests.sh ./tools/pretty_tox.sh "{posargs}" {toxinidir}/run-functional-tests.sh ./tools/pretty_tox.sh "{posargs}"
# NOTE(chdent): The gabbi tests are also run under the primary tox
# targets. This target simply provides a target to directly run just
# gabbi tests without needing to discovery across the entire body of
# tests.
[testenv:gabbi]
deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/gabbi
commands =
pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --testr-args="{posargs}"
[testenv:cover] [testenv:cover]
commands = commands =
pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --slowest --coverage --testr-args="{posargs}" pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --slowest --coverage --testr-args="{posargs}"