From 650bbc5755c14ab892e2d6def220a4dc14457a81 Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Wed, 11 Jul 2018 10:42:10 +0700 Subject: [PATCH] Switch to stestr According to Openstack summit session [1], stestr is maintained project to which all Openstack projects should migrate. Let's switch to stestr as other projects have already moved to it. [1] https://etherpad.openstack.org/p/YVR-python-pti Change-Id: Ie17b8fd07604e030e6ea6b9ded75e85794cb881a --- .gitignore | 2 +- .stestr.conf | 4 ++++ .testr.conf | 9 --------- requirements.txt | 6 +++--- test-requirements.txt | 11 +++++------ tox.ini | 38 +++++++++++++------------------------- 6 files changed, 26 insertions(+), 44 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 950651e..2d11956 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ coverage.xml *.py[co] .DS_Store *.log -.testrepository +.stestr/ subunit.log .eggs AUTHORS diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..5228f20 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./tests/unit} +top_dir=./ + diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 752a278..0000000 --- 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_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \ - ${PYTHON:-python} -m subunit.run discover -s ${OS_TEST_PATH:-./tests/unit} -t . $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list -group_regex=([^\.]+\.)+ diff --git a/requirements.txt b/requirements.txt index 8253f19..cc3ea3c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,10 +2,10 @@ pbr>=1.8 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0 python-monascaclient>=1.1.0 # Apache-2.0 python-neutronclient>=5.1.0 # Apache-2.0 -python-novaclient>=6.0.0,!=7.0.0 # Apache-2.0 +python-novaclient>=6.0.0 # Apache-2.0 PyYAML>=3.10.0 # MIT -oslo.config>=3.14.0,!=3.18.0 # Apache-2.0 +oslo.config>=3.14.0 # Apache-2.0 oslo.utils>=3.18.0 # Apache-2.0 oslo.log>=3.11.0 # Apache-2.0 libvirt-python>=1.2.5 # LGPLv2+ -Jinja2>=2.8,!=2.9.0,!=2.9.1,!=2.9.2,!=2.9.3,!=2.9.4 # BSD License (3 clause) +Jinja2>=2.8 # BSD License (3 clause) diff --git a/test-requirements.txt b/test-requirements.txt index 954e02c..7b925f6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,13 +5,12 @@ astroid===1.3.6 flake8>=2.5.4,<2.6.0 # MIT hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0 coverage>=3.6 -discover # BSD -mock>=1.0,<1.1.0 +mock>=1.0 pep8==1.5.7 mccabe==0.2.1 # MIT License pylint==1.4.4 # GNU GPL v2 pyflakes==0.8.1 -testrepository>=0.0.18 -testtools>=0.9.36,!=1.2.0,<2.0.0 -oslosphinx>=2.5.0,!=3.4.0 # Apache-2.0 -sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD +stestr>=2.0.0 # Apache-2.0 +testtools>=0.9.36 +oslosphinx>=2.5.0 # Apache-2.0 +sphinx>=1.1.2 # BSD diff --git a/tox.ini b/tox.ini index 9ab4130..6227acd 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,19 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY install_command = pip install -U {opts} {packages} -setenv = VIRTUAL_ENV={envdir} +setenv = + VIRTUAL_ENV={envdir} + OS_TEST_PATH = ./tests/unit + PYTHON=coverage run --source freezer_dr --parallel-mode +commands = + find . -type f -name "*.pyc" -delete + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml +# coverage report -m + rm -f .coverage + rm -rf .testrepository whitelist_externals = find @@ -36,36 +48,12 @@ commands = [testenv:py27] basepython = python2.7 -setenv = - OS_TEST_PATH = ./tests/unit -commands = - find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args="{posargs}" -# coverage report -m - rm -f .coverage - rm -rf .testrepository [testenv:py35] basepython = python3.5 -setenv = - OS_TEST_PATH = ./tests/unit -commands = - find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args="{posargs}" -# coverage report -m - rm -f .coverage - rm -rf .testrepository [testenv:py36] basepython = python3.6 -setenv = - OS_TEST_PATH = ./tests/unit -commands = - find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args="{posargs}" -# coverage report -m - rm -f .coverage - rm -rf .testrepository [testenv:pep8] commands = flake8 freezer_dr