Browse Source

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: Ib58745d5c0d98fb79eb3cf7278c2cbfb5160efcd
changes/12/581212/8
Vu Cong Tuan 3 years ago
committed by Bernard Cafarelli
parent
commit
259c386d42
No known key found for this signature in database GPG Key ID: D148244A3C2462BD
  1. 2
      .gitignore
  2. 3
      .stestr.conf
  3. 4
      .testr.conf
  4. 3
      lower-constraints.txt
  5. 10
      neutronclient/tests/functional/hooks/post_test_hook.sh
  6. 2
      test-requirements.txt
  7. 12
      tox.ini

2
.gitignore

@ -17,6 +17,6 @@ run_tests.err.log
run_tests.log
.autogenerated
.coverage
.testrepository/
.stestr/
.tox/
.venv/

3
.stestr.conf

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

4
.testr.conf

@ -1,4 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutronclient/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

3
lower-constraints.txt

@ -105,11 +105,10 @@ snowballstemmer==1.2.1
Sphinx==1.6.2
sphinxcontrib-websupport==1.0.1
statsd==3.2.1
stestr==1.0.0
stestr==2.0.0
stevedore==1.20.0
tempest==17.1.0
tenacity==3.2.1
testrepository==0.0.18
testscenarios==0.4
testtools==2.2.0
traceback2==1.4.0

10
neutronclient/tests/functional/hooks/post_test_hook.sh

@ -32,11 +32,11 @@ function generate_test_logs {
function generate_testr_results {
# Give job user rights to access tox logs
sudo -H -u $USER chmod o+rw .
sudo -H -u $USER chmod o+rw -R .testrepository
if [ -f ".testrepository/0" ] ; then
.tox/$VENV/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit
$SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html
gzip -9 ./testrepository.subunit
sudo -H -u $USER chmod o+rw -R .stestr
if [ -f ".stestr/0" ] ; then
.tox/$VENV/bin/subunit-1to2 < .stestr/0 > ./stestr.subunit
$SCRIPTS_DIR/subunit2html ./stestr.subunit testr_results.html
gzip -9 ./stestr.subunit
gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/
fi

2
test-requirements.txt

@ -13,7 +13,7 @@ osprofiler>=2.3.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD
requests-mock>=1.2.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
testscenarios>=0.4 # Apache-2.0/BSD
tempest>=17.1.0 # Apache-2.0

12
tox.ini

@ -21,7 +21,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/re
commands = sh -c "find . -type d -name '.?*' -prune -o \
\( -type d -name '__pycache__' -o -type f -name '*.py[co]' \) \
-print0 | xargs -0 rm -rf"
python setup.py testr --testr-args='{posargs}'
stestr run {posargs}
whitelist_externals = sh
[testenv:pep8]
@ -47,9 +47,15 @@ setenv =
[testenv:cover]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source neutronclient --parallel-mode
commands =
python setup.py test --coverage --coverage-package-name=neutronclient --testr-args='{posargs}'
coverage report
stestr run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
basepython = python3

Loading…
Cancel
Save