From 9586972ddd50fab9a4d0349d91f8dcb125193cb7 Mon Sep 17 00:00:00 2001 From: Witold Bedyk Date: Mon, 2 Jul 2018 13:20:05 +0200 Subject: Migrate to stestr for running tests stestr is recommended by OpenStack Project Testing Interface for running tests [1]. This change migrates to stestr for running unit tests and coverage job. Modified `cover` env allows running it as Zuul job and visualising its results in Gerrit. [1] https://governance.openstack.org/tc/reference/pti/python.html#python-test-running Change-Id: I9e8b79d7a18cd36946daff10abb1a2f43b1aa3a1 --- tox.ini | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tox.ini') diff --git a/tox.ini b/tox.ini index 528739a2..cf56f83b 100644 --- a/tox.ini +++ b/tox.ini @@ -10,19 +10,22 @@ deps = .[gnocchi,zaqar] install_command = pip install -U {opts} {packages} usedevelop = True setenv = VIRTUAL_ENV={envdir} - OS_TEST_PATH=ceilometer/tests/unit CEILOMETER_TEST_BACKEND={env:CEILOMETER_TEST_BACKEND:none} passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE CEILOMETER_* commands = - {toxinidir}/tools/pretty_tox.sh "{posargs}" + stestr run {posargs} oslo-config-generator --config-file=etc/ceilometer/ceilometer-config-generator.conf whitelist_externals = bash [testenv:cover] basepython = python3 -setenv = OS_TEST_PATH=ceilometer/tests +setenv = + PYTHON=coverage run --source ceilometer --parallel-mode commands = - python setup.py testr --slowest --coverage --testr-args="{posargs}" + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:pep8] basepython = python3 -- cgit v1.2.1