Browse Source

Switch to use stestr instead of os-testr

This commit switches to use stestr instead of os-testr. It should be
better to reduce the test runner complexity.

Change-Id: Ia16ad5ed6d9ed7be9dc6902f875b0144b24a938a
changes/98/528198/2
Masayuki Igawa 1 year ago
parent
commit
e541da94aa
No account linked to committer's email address
5 changed files with 18 additions and 10 deletions
  1. 1
    0
      .gitignore
  2. 3
    0
      .stestr.conf
  3. 0
    7
      .testr.conf
  4. 1
    1
      test-requirements.txt
  5. 13
    2
      tox.ini

+ 1
- 0
.gitignore View File

@@ -30,6 +30,7 @@ cover/
30 30
 .tox
31 31
 nosetests.xml
32 32
 .testrepository
33
+.stestr
33 34
 .venv
34 35
 
35 36
 # Translations

+ 3
- 0
.stestr.conf View File

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

+ 0
- 7
.testr.conf View File

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

+ 1
- 1
test-requirements.txt View File

@@ -14,7 +14,7 @@ testscenarios>=0.4 # Apache-2.0/BSD
14 14
 testtools>=1.4.0 # MIT
15 15
 PyMySQL>=0.7.6 # MIT License
16 16
 psycopg2>=2.5 # LGPL/ZPL
17
-os-testr>=0.8.0 # Apache-2.0
17
+stestr>=1.0.0 # Apache-2.0
18 18
 reno>=1.8.0 # Apache-2.0
19 19
 oslo.concurrency>=3.8.0 # Apache-2.0
20 20
 six>=1.9.0 # MIT

+ 13
- 2
tox.ini View File

@@ -12,7 +12,7 @@ deps = -r{toxinidir}/requirements.txt
12 12
        -r{toxinidir}/test-requirements.txt
13 13
 commands =
14 14
     find . -type f -name "*.pyc" -delete
15
-    ostestr {posargs}
15
+    stestr run {posargs}
16 16
 
17 17
 [testenv:pep8]
18 18
 sitepackages = False
@@ -23,7 +23,18 @@ commands =
23 23
 commands = {posargs}
24 24
 
25 25
 [testenv:cover]
26
-commands = python setup.py test --coverage --testr-args='{posargs}'
26
+setenv =
27
+    {[testenv]setenv}
28
+    PYTHON=coverage run --source coverage2sql --parallel-mode
29
+commands =
30
+    coverage erase
31
+    find . -type f -name "*.pyc" -delete
32
+    stestr --test-path ./coverage2sql/tests run {posargs}
33
+    coverage combine
34
+    coverage html -d cover
35
+    coverage xml -o cover/coverage.xml
36
+    coverage report
37
+
27 38
 
28 39
 [testenv:docs]
29 40
 commands = python setup.py build_sphinx

Loading…
Cancel
Save