Browse Source

Replace testr with stestr

Switch to use stestr which is maintained as opposed
to testrepository (testr) which became a defunct project.

Change-Id: If53c985b6cf3b4122596f09ec4d0ec4a186688b8
changes/24/558924/3
Sorin Sbarnea 4 years ago
parent
commit
9f143f1241
  1. 2
      .gitignore
  2. 3
      .stestr.conf
  3. 4
      .testr.conf
  4. 2
      test-requirements.txt
  5. 19
      tox.ini

2
.gitignore

@ -17,3 +17,5 @@
# Unit test / coverage reports
cover/
/.stestr

3
.stestr.conf

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

4
.testr.conf

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

2
test-requirements.txt

@ -6,6 +6,6 @@ python-subunit
requests-mock>=1.4.0
requests-kerberos
sphinx>=1.2,<1.3.0
testrepository
stestr>=2.0.0
testscenarios
testtools

19
tox.ini

@ -4,14 +4,27 @@ skipsdist = True
envlist = py{34,27,35}, pep8, pypy
[testenv]
setenv VIRTUAL_ENV={envdir}
setenv =
PYTHONDONTWRITEBYTECODE=1
VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
commands =
- find . -type f -name "*.pyc" -delete
- find . -type d -name "__pycache__" -delete
stestr run --slowest {posargs}
whitelist_externals = find
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
setenv =
{[testenv]setenv}
PYTHON=coverage run --source jenkins --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:pep8]
commands = flake8

Loading…
Cancel
Save