summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2018-09-10 12:51:52 +0200
committerDmitry Tantsur <divius.inside@gmail.com>2018-09-10 13:05:02 +0200
commitd12d966218359e1a8d46db86fcc167fd751cb805 (patch)
tree92ba5ade740915429a9b6e453c1e94c2a6afe7e0
parentc7b36754be2a80ba692433027b8d767fb282fe7a (diff)
Switch to stestr for unit tests
Moves coverage to a separate test environment and CI job. Change-Id: I94697ba41afbae194136202dfab349eb0367a125
Notes
Notes (review): Code-Review+2: Dmitry Tantsur <divius.inside@gmail.com> Workflow+1: Dmitry Tantsur <divius.inside@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 10 Sep 2018 13:33:39 +0000 Reviewed-on: https://review.openstack.org/601247 Project: openstack/metalsmith Branch: refs/heads/master
-rw-r--r--.gitignore2
-rw-r--r--.stestr.conf2
-rw-r--r--.zuul.yaml1
-rw-r--r--lower-constraints.txt1
-rw-r--r--test-requirements.txt1
-rw-r--r--tox.ini20
6 files changed, 23 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 372f4b8..765ace8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,7 @@ develop-eggs
24# Other 24# Other
25*.DS_Store 25*.DS_Store
26.idea 26.idea
27.testrepository 27.stestr
28.tox 28.tox
29.venv 29.venv
30.*.swp 30.*.swp
diff --git a/.stestr.conf b/.stestr.conf
new file mode 100644
index 0000000..552cc81
--- /dev/null
+++ b/.stestr.conf
@@ -0,0 +1,2 @@
1[DEFAULT]
2test_path=./metalsmith/test
diff --git a/.zuul.yaml b/.zuul.yaml
index bb2e186..eaa5178 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -172,6 +172,7 @@
172 - openstack-python35-jobs 172 - openstack-python35-jobs
173 - openstack-python36-jobs 173 - openstack-python36-jobs
174 - openstack-lower-constraints-jobs 174 - openstack-lower-constraints-jobs
175 - openstack-cover-jobs
175 - docs-on-readthedocs 176 - docs-on-readthedocs
176 vars: 177 vars:
177 rtd_webhook_id: '37378' 178 rtd_webhook_id: '37378'
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 7a99004..0cbdc85 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -54,6 +54,7 @@ requestsexceptions==1.4.0
54restructuredtext-lint==1.1.3 54restructuredtext-lint==1.1.3
55simplejson==3.15.0 55simplejson==3.15.0
56six==1.10.0 56six==1.10.0
57stestr==1.0.0
57stevedore==1.28.0 58stevedore==1.28.0
58testtools==2.2.0 59testtools==2.2.0
59traceback2==1.4.0 60traceback2==1.4.0
diff --git a/test-requirements.txt b/test-requirements.txt
index 4106cf0..fffd808 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,5 +7,6 @@ flake8-import-order>=0.13 # LGPLv3
7fixtures>=3.0.0 # Apache-2.0/BSD 7fixtures>=3.0.0 # Apache-2.0/BSD
8hacking>=1.0.0 # Apache-2.0 8hacking>=1.0.0 # Apache-2.0
9mock>=2.0 # BSD 9mock>=2.0 # BSD
10stestr>=1.0.0 # Apache-2.0
10testtools>=2.2.0 # MIT 11testtools>=2.2.0 # MIT
11Pygments>=2.2.0 # BSD 12Pygments>=2.2.0 # BSD
diff --git a/tox.ini b/tox.ini
index 5cf1923..73d8a82 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,16 +3,30 @@ envlist = py3,py27,pep8
3 3
4[testenv] 4[testenv]
5usedevelop = True 5usedevelop = True
6setenv = VIRTUAL_ENV={envdir}
7 LANGUAGE=en_US
8 LC_ALL=en_US.UTF-8
9 PYTHONWARNINGS=default::DeprecationWarning
10 PYTHONDONTWRITEBYTECODE=1
6deps = 11deps =
7 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} 12 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
8 -r{toxinidir}/requirements.txt 13 -r{toxinidir}/requirements.txt
9 -r{toxinidir}/test-requirements.txt 14 -r{toxinidir}/test-requirements.txt
10commands = 15commands =
11 coverage run --branch --include "metalsmith*" -m unittest discover metalsmith.test 16 stestr run {posargs}
12 coverage report -m --fail-under 90
13setenv = PYTHONDONTWRITEBYTECODE=1
14passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY 17passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
15 18
19[testenv:cover]
20basepython = python3
21setenv = {[testenv]setenv}
22 PYTHON=coverage run --branch --source metalsmith --parallel-mode
23commands =
24 coverage erase
25 stestr run {posargs}
26 coverage combine
27 coverage report -m --fail-under 90
28 coverage html -d ./cover --omit='*test*'
29
16[testenv:venv] 30[testenv:venv]
17deps = 31deps =
18 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} 32 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}