Browse Source

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>
changes/81/533381/1
lijunbo 4 years ago
committed by junboli
parent
commit
e8bca58887
  1. 1
      .gitignore
  2. 8
      .testr.conf
  3. 1
      test-requirements.txt
  4. 4
      tools/cover.sh
  5. 6
      tox.ini

1
.gitignore

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

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=${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

1
test-requirements.txt

@ -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

4
tools/cover.sh

@ -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)

6
tox.ini

@ -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 =

Loading…
Cancel
Save