Use stestr for coverage

Change [1] restored .testr.conf since it was needed for the manila
coverage job.

Modify script used by the coverage job to invoke stestr rather than
setup.py with testr so that this job no longer requires .testr.conf
so remove the dotfile and update .gitignore.
TrivialFix

[1] I451e383ed654d00a5a017cb28521c47566911f33

Change-Id: Ibf549220303395744380f79993fbfcf04b2ed5b7
Co-Authored-By: Tom Barron <tpb@dyncloud.net>
This commit is contained in:
lijunbo 2018-01-14 13:18:36 +08:00 committed by junboli
parent 158fef40b2
commit e8bca58887
5 changed files with 7 additions and 13 deletions

1
.gitignore vendored
View File

@ -9,7 +9,6 @@
.manila-venv
.coverage
.stestr/*
.testrepository
.tox
.venv
.idea

View File

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

View File

@ -24,7 +24,6 @@ requests-mock>=1.1.0 # Apache-2.0
sphinx>=1.6.2 # BSD
os-api-ref>=1.4.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT

View File

@ -29,7 +29,7 @@ uncommitted=$(git status --porcelain | grep -v "^??")
git checkout HEAD^
baseline_report=$(mktemp -t manila_coverageXXXXXXX)
find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$TESTR_ARGS"
find . -type f -name "*.py[c|o]" -delete && stestr run "$TESTR_ARGS" && coverage combine && coverage html -d cover
coverage report --ignore-errors > $baseline_report
baseline_missing=$(awk 'END { print $3 }' $baseline_report)
@ -39,7 +39,7 @@ git checkout -
# Generate and save coverage report
current_report=$(mktemp -t manila_coverageXXXXXXX)
find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$TESTR_ARGS"
find . -type f -name "*.py[c|o]" -delete && stestr run "$TESTR_ARGS" && coverage combine && coverage html -d cover
coverage report --ignore-errors > $current_report
current_missing=$(awk 'END { print $3 }' $current_report)

View File

@ -72,7 +72,11 @@ commands =
doc8 --ignore D001 --ignore-path .tox --ignore-path doc/build --ignore-path manila.egg-info -e txt -e rst
[testenv:cover]
commands = {toxinidir}/tools/cover.sh {posargs}
setenv =
{[testenv]setenv}
PYTHON=coverage run --source manila --parallel-mode
commands =
{toxinidir}/tools/cover.sh {posargs}
[testenv:fast8]
commands =