From a83c908072407a81f71bbadf1b1998c1b1844792 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Sun, 30 Mar 2014 16:14:16 -0700 Subject: [PATCH] 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 --- .testr.conf | 2 +- test-requirements.txt | 6 ++++++ tox.ini | 9 +++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.testr.conf b/.testr.conf index 6c1541e..1a61078 100644 --- a/.testr.conf +++ b/.testr.conf @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index 9dd7463..71b8037 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 65d647a..de841db 100644 --- a/tox.ini +++ b/tox.ini @@ -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