Browse Source

Switch to stestr to comply with OpenStack python guidelines[1]

[1] https://governance.openstack.org/tc/reference/pti/python.html#python-test-running

Change-Id: I8530c8ad9c325ef075823df2268822be73741cb1
changes/77/569877/1
Mark McClain 3 years ago
parent
commit
6b5dd6b19b
  1. 3
      .stestr.conf
  2. 8
      .testr.conf
  3. 2
      test-requirements.txt
  4. 13
      tox.ini

3
.stestr.conf

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./networking_arista/tests/unit
top_dir=./

8
.testr.conf

@ -1,8 +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:-60} \
OS_LOG_CAPTURE=1 \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

2
test-requirements.txt

@ -9,7 +9,7 @@ python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
oslosphinx>=4.7.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=1.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD

13
tox.ini

@ -11,8 +11,10 @@ deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
whitelist_externals = sh
commands = python setup.py testr --slowest --testr-args='{posargs}'
whitelist_externals =
find
commands =
stestr run {posargs}
[testenv:pep8]
commands =
@ -23,7 +25,12 @@ commands =
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
commands =
find networking_arista -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
commands = python setup.py build_sphinx

Loading…
Cancel
Save