Update tox.ini to also run nova tests

This updates testr.conf to allow passing of the tests directory as an
environment variable (defaulting to ironic/tests/). Also updates tox.ini
to run testr once for ironic/tests and once for ironic/nova/tests/, then
combine subunit output.

test-requirements.txt is updated to pull in Nova from a tarball, as well
as mox and python-ironicclient.

Updates the existing Nova driver unit tests to account for recent
refactoring and changes in the Nova virt API.

Change-Id: Ibefa2e0d3f97512f4da9ace780703fe47467232e
Closes-bug: #1299312
This commit is contained in:
Adam Gandelman
2014-03-30 16:14:16 -07:00
parent c8499cc853
commit a83c908072
3 changed files with 12 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ $LISTOPT $IDOPTION
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ${TESTS_DIR:-./ironic/tests/} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@@ -6,6 +6,7 @@ mock>=1.0
Babel>=1.3
MySQL-python
psycopg2
python-ironicclient
python-subunit>=0.0.18
testrepository>=0.0.18
testtools>=0.9.34
@@ -14,3 +15,8 @@ testtools>=0.9.34
sphinx>=1.1.2,<1.2
sphinxcontrib-pecanwsme>=0.6
oslosphinx
# Required for Nova unit tests in ironic/nova/tests/ and can be removed
# once the driver code lands in Nova.
http://tarballs.openstack.org/nova/nova-master.tar.gz#egg=nova
mox>=0.5.3

View File

@@ -9,10 +9,11 @@ install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
python setup.py testr --slowest --testr-args='{posargs}'
whitelist_externals = bash
commands =
bash -c "TESTS_DIR=./ironic/tests/ python setup.py testr --slowest --testr-args='{posargs}'"
bash -c "TESTS_DIR=./ironic/nova/tests/ python setup.py testr --slowest --testr-args='{posargs}'"
bash -c "cat .testrepository/1 >>.testrepository/0"
[tox:jenkins]
downloadcache = ~/cache/pip
@@ -37,7 +38,7 @@ commands = {posargs}
ignore = E12,E711
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova*
[hacking]
import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers