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>
tags/6.0.0.0b3
lijunbo 1 year ago
parent
commit
e8bca58887
5 changed files with 7 additions and 13 deletions
  1. 0
    1
      .gitignore
  2. 0
    8
      .testr.conf
  3. 0
    1
      test-requirements.txt
  4. 2
    2
      tools/cover.sh
  5. 5
    1
      tox.ini

+ 0
- 1
.gitignore View File

@@ -9,7 +9,6 @@
9 9
 .manila-venv
10 10
 .coverage
11 11
 .stestr/*
12
-.testrepository
13 12
 .tox
14 13
 .venv
15 14
 .idea

+ 0
- 8
.testr.conf View File

@@ -1,8 +0,0 @@
1
-[DEFAULT]
2
-test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
3
-             OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
4
-             OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
5
-             OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \
6
-             ${PYTHON:-python} -m subunit.run discover -t ./ ./manila/tests $LISTOPT $IDOPTION
7
-test_id_option=--load-list $IDFILE
8
-test_list_option=--list

+ 0
- 1
test-requirements.txt View File

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

+ 2
- 2
tools/cover.sh View File

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

+ 5
- 1
tox.ini View File

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

Loading…
Cancel
Save