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: I4defbb8d866ae847253d4873891f7d2eb2593ed6
This commit is contained in:
Vu Cong Tuan 2018-07-12 15:29:17 +07:00
parent 183726646d
commit 1bd1f9e639
6 changed files with 46 additions and 31 deletions

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
/build/
.testrepository
.stestr/
.tox/
ceilometer_powervm.egg-info/
*.pyc
@ -7,3 +7,5 @@ doc/build
AUTHORS
ChangeLog
/.idea/
.coverage
cover/

4
.stestr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=./ceilometer_powervm/tests
top_dir=./

View File

@ -1,7 +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 -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -7,11 +7,10 @@ bashate>=0.5.1 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
oslotest>=3.2.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
oslosphinx>=4.7.0 # Apache-2.0
mock>=2.0.0 # BSD

View File

@ -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

43
tox.ini
View File

@ -11,16 +11,39 @@ ignore_basepython_conflict = True
basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
setenv =
VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
LANGUAGE=en_US
LC_ALL=en_US.utf-8
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-egit+https://git.openstack.org/openstack/ceilometer#egg=ceilometer
-rhttps://git.openstack.org/cgit/openstack/ceilometer/plain/test-requirements.txt
whitelist_externals = bash
commands = bash tools/pretty_tox.sh '{posargs}'
whitelist_externals =
bash
find
commands =
find . -type f -name "*.pyc" -delete
[testenv:py27]
basepython = python2.7
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py35]
basepython = python3.5
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:pep8]
commands = flake8
@ -29,7 +52,17 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python -m ceilometer.openstack.common.lockutils python setup.py testr --slowest --coverage --testr-args="{posargs}"
setenv =
{[testenv]setenv}
PYTHON=coverage run --source ceilometer_powervm --parallel-mode
commands =
{[testenv]commands}
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
commands = python setup.py build_sphinx