Merge "Switch to stestr"

This commit is contained in:
Zuul 2018-07-25 16:34:49 +00:00 committed by Gerrit Code Review
commit 33cbc5addf
9 changed files with 38 additions and 38 deletions

3
.gitignore vendored
View File

@ -27,11 +27,10 @@ pip-log.txt
# Unit test / coverage reports
cover
.testrepository
.stestr/
.coverage
.coverage.*
.tox
nosetests.xml
coverage.xml
flake8.log

4
.stestr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./barbican/tests/}
top_dir=./

View File

@ -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:-./barbican/tests/} -t . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list
group_regex=([^\.]+\.)+

View File

@ -94,7 +94,7 @@ install_barbican()
pip install -e .
# Run unit tests
python setup.py testr
stestr run
start_barbican
}

View File

@ -5,4 +5,4 @@ reno>=2.5.0 # Apache-2.0
os-api-ref>=1.4.0 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0
castellan >= 0.17 # Apache-2.0
pykmip==0.7.0 # Apache 2.0 License
pykmip>=0.7.0 # Apache 2.0 License

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
set -o pipefail
TESTRARGS=$1
python setup.py testr --coverage --testr-args="--subunit $TESTRARGS" | subunit-trace --no-failure-debug -f
retval=$?
echo -e "\nSlowest Tests:\n"
testr slowest
exit $retval

View File

@ -60,7 +60,6 @@ netifaces==0.10.6
openstackdocstheme==1.18.1
os-api-ref==1.4.0
os-client-config==1.29.0
os-testr==1.0.0
oslo.cache==1.29.0
oslo.concurrency==3.26.0
oslo.config==5.2.0
@ -123,7 +122,6 @@ stevedore==1.20.0
tempest==17.1.0
Tempita==0.5.2
tenacity==4.9.0
testrepository==0.0.18
testresources==2.0.1
testscenarios==0.5.0
testtools==2.2.0

View File

@ -9,9 +9,8 @@ coverage!=4.4,>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT
mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
pykmip==0.7.0 # Apache 2.0 License
testrepository>=0.0.18 # Apache-2.0/BSD
pykmip>=0.7.0 # Apache 2.0 License
stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
fixtures>=3.0.0 # Apache-2.0/BSD
requests>=2.14.2 # Apache-2.0

39
tox.ini
View File

@ -4,6 +4,8 @@ envlist = py35,py27,pep8,docs
skipsdist = True
[testenv]
setenv =
PYTHON=coverage run --source barbican --parallel-mode
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
@ -14,7 +16,10 @@ commands =
/usr/bin/find . -type f -name "*.py[c|o]" -delete
rm -f .testrepository/times.dbm
coverage erase
python setup.py testr --coverage --testr-args='{posargs}'
stestr run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report -m
whitelist_externals = rm
@ -25,9 +30,11 @@ deps =
diff_cover
commands =
coverage erase
python setup.py testr --coverage --testr-args='{posargs}'
coverage xml
diff-cover --fail-under 100 --compare-branch master coverage.xml
stestr run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
diff-cover --fail-under 100 --compare-branch master cover/coverage.xml
[testenv:releasenotes]
basepython = python3
@ -97,19 +104,27 @@ commands =
# This tox env is purely to make local test development easier
# Note: This requires local running instances of Barbican and Keystone
deps = -r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH={toxinidir}/functionaltests
setenv =
OS_TEST_PATH={toxinidir}/functionaltests
commands =
/usr/bin/find . -type f -name "*.py[c|o]" -delete
/bin/bash {toxinidir}/functionaltests/pretty_tox.sh '{posargs}'
stestr run --slowest {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
passenv = KMIP_PLUGIN_ENABLED
[testenv:py35functional]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH={toxinidir}/functionaltests
setenv =
OS_TEST_PATH={toxinidir}/functionaltests
commands =
/usr/bin/find . -type f -name "*.py[c|o]" -delete
/bin/bash {toxinidir}/functionaltests/pretty_tox.sh '{posargs}'
stestr run --slowest {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
passenv = KMIP_PLUGIN_ENABLED
[testenv:cmd]
@ -117,10 +132,14 @@ basepython = python3
# This tox env is purely to make local test development easier
# Note: This requires local running instances of Barbican and Keystone
deps = -r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH={toxinidir}/barbican/cmd/functionaltests
setenv =
OS_TEST_PATH={toxinidir}/barbican/cmd/functionaltests
commands =
/usr/bin/find . -type f -name "*.py[c|o]" -delete
/bin/bash {toxinidir}/functionaltests/pretty_tox.sh '{posargs}'
stestr run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[flake8]
filename = *.py,app.wsgi