From 93746a9b2895d44fd105ba26ae77ddffbe2db167 Mon Sep 17 00:00:00 2001 From: rabi Date: Fri, 15 Dec 2017 12:08:54 +0530 Subject: [PATCH] Use stestr for unit tests Change-Id: Ifaf3991e1c9400683e9c98185b86cb39ac3d318d --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 8 -------- tox.ini | 6 +++--- 4 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index c307e065e3..3235d9e531 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ tags heat-test.db heat.sqlite .venv +.stestr/* AUTHORS ChangeLog templates/cloudformation-examples diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000000..0d94bfb92d --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TEST_PATH:-./heat/tests} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 044f5a32a0..0000000000 --- a/.testr.conf +++ /dev/null @@ -1,8 +0,0 @@ -[DEFAULT] -test_command= - PYTHON=$(echo ${PYTHON:-python} | sed 's/--source heat//g') - START_AT=${TESTR_START_DIR:-.} - ${PYTHON} -m subunit.run discover -s $START_AT -t . $LISTOPT $IDOPTION - if [ "$START_AT" = "." ]; then for plugin in $START_AT/contrib/*; do ${PYTHON} -m subunit.run discover -s $plugin $LISTOPT $IDOPTION; done; fi -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/tox.ini b/tox.ini index 64f9b74989..1fa7d27ddb 100644 --- a/tox.ini +++ b/tox.ini @@ -7,14 +7,14 @@ skipsdist = True setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning OS_TEST_PATH=heat/tests - TESTR_START_DIR=heat/tests usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete - python setup.py testr --slowest --testr-args='{posargs}' + stestr run '{posargs}' + stestr slowest whitelist_externals = bash @@ -24,7 +24,7 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:py27log] commands = find . -type f -name "*.py[c|o]" -delete - ostestr '^(?!heat_integrationtests){posargs}' + stestr run '^(?!heat_integrationtests){posargs}' [testenv:pep8] commands =