diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..d676cbd --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./fuelclient/tests/unit} $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index efdaa64..b1d481f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,11 +2,10 @@ hacking>=0.10.0,<0.11 mock>=1.0 oslotest>=1.5.1,<1.6.0 # Apache-2.0 requests-mock>=0.6.0 # Apache-2.0 +testrepository>=0.0.18 testtools>=0.9.36,!=1.2.0 # Files beyond this line are not in Global Requirements list # and must be added there. pyprof2calltree>=1.3.2 gprof2dot>=2014.09.29 -pytest<2.8.0 -pytest-cov>=2.0.0 diff --git a/tox.ini b/tox.ini index 7521c45..c5d378b 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py26,py27,pep8,functional,cleanup usedevelop = True install_command = pip install --allow-external -U {opts} {packages} whitelist_externals = bash + oslo_debug_helper setenv = VIRTUAL_ENV={envdir} ARTIFACTS={toxinidir}/{env:ARTIFACTS:test_run} FUELCLIENT_JUNIT={env:FUELCLIENT_JUNIT:fuelclient}-{envname}.xml @@ -29,13 +30,22 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - py.test -vv --junit-xml $FUELCLIENT_JUNIT {posargs:fuelclient/tests/unit} + bash -c "TESTS_DIR={posargs:./fuelclient/tests/unit} python setup.py test --slowest" [testenv:functional] commands = bash {toxinidir}/tools/cleanup.sh bash {toxinidir}/tools/prepare_nailgun.sh - py.test -vv --junit-xml $FUELCLIENT_JUNIT {posargs:fuelclient/tests/functional} + bash -c "TESTS_DIR={posargs:./fuelclient/tests/functional} python setup.py test --slowest" + +[testenv:dbgunit] +commands = oslo_debug_helper -t {toxinidir}/fuelclient/tests/unit {posargs} + +[testenv:dbgfunc] +commands = + bash {toxinidir}/tools/cleanup.sh + bash {toxinidir}/tools/prepare_nailgun.sh + oslo_debug_helper -t {toxinidir}/fuelclient/tests/functional {posargs} [testenv:cleanup] commands = @@ -53,7 +63,7 @@ commands = [testenv:cover] commands = - py.test -vv --junit-xml $FUELCLIENT_JUNIT --cov=fuelclient {posargs:fuelclient/tests/unit} + bash -c "TESTS_DIR={posargs:./fuelclient/tests/unit} python setup.py testr --coverage" [testenv:venv] commands = {posargs:}