diff --git a/.gitignore b/.gitignore index 1d8ef2c1ab..1f909134a8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ *.mo *.pyc .coverage -.testrepository +.stestr .tox AUTHORS build/* diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000000..d405a59ed1 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-ceilometer/tests/unit} +top_dir=./ \ No newline at end of file diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index f8f2847a3d..0000000000 --- a/.testr.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-600} \ - ${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-./ceilometer/tests} -t . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list -# NOTE(chdent): Only used/matches on gabbi-related tests. -group_regex=(gabbi\.(suitemaker|driver)\.test_gabbi_(?:prefix_|)[^_]+)_ diff --git a/.zuul.yaml b/.zuul.yaml index 0021380678..8264183eb8 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -27,6 +27,7 @@ check: jobs: - telemetry-tox-py37 + - openstack-tox-cover - grenade-dsvm-ceilometer: irrelevant-files: - ^(test-|)requirements.txt$ diff --git a/test-requirements.txt b/test-requirements.txt index 9d66dad747..cb9b38f033 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,10 +13,9 @@ oslotest>=2.15.0 # Apache-2.0 oslo.vmware>=1.16.0 # Apache-2.0 pyOpenSSL>=0.14 # Apache-2.0 sphinx>=1.6.2 # BSD -testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT gabbi>=1.30.0 # Apache-2.0 requests-aws>=0.1.4 # BSD License (3 clause) -os-testr>=0.4.1 # Apache-2.0 kafka-python>=1.3.2 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh deleted file mode 100755 index 799ac18487..0000000000 --- a/tools/pretty_tox.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail - -TESTRARGS=$1 - -# --until-failure is not compatible with --subunit see: -# -# https://bugs.launchpad.net/testrepository/+bug/1411804 -# -# this work around exists until that is addressed -if [[ "$TESTARGS" =~ "until-failure" ]]; then - python setup.py testr --slowest --testr-args="$TESTRARGS" -else - python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f -fi diff --git a/tox.ini b/tox.ini index 528739a21b..cf56f83b03 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