Browse Source

Add coverage job

This patch set adds in a python coverage job for pegleg using pytest.

Change-Id: Ice0332cc454f488e0372d5ab03e8b0a37db9efd1
Signed-off-by: Tin Lam <tin@irrational.io>
Tin Lam 5 months ago
parent
commit
178c058474
2 changed files with 10 additions and 1 deletions
  1. 1
    0
      .zuul.yaml
  2. 9
    1
      tox.ini

+ 1
- 0
.zuul.yaml View File

@@ -14,6 +14,7 @@
14 14
     templates:
15 15
       - openstack-python35-jobs
16 16
       - openstack-python36-jobs
17
+      - openstack-cover-jobs
17 18
     check:
18 19
       jobs:
19 20
         - openstack-tox-pep8

+ 9
- 1
tox.ini View File

@@ -1,5 +1,5 @@
1 1
 [tox]
2
-envlist = py35, py36, pep8, docs
2
+envlist = py35, py36, pep8, docs, cover
3 3
 minversion = 2.3.1
4 4
 # Allows docs to be built without setup.py having to exist. Requires that
5 5
 # usedevelop be False as well (which it is by default).
@@ -47,6 +47,14 @@ commands =
47 47
 basepython=python3
48 48
 commands = bandit -r pegleg -n 5
49 49
 
50
+[testenv:cover]
51
+basepython = python3
52
+deps =
53
+  -r{toxinidir}/requirements.txt
54
+  -r{toxinidir}/test-requirements.txt
55
+commands =
56
+  pytest --cov=pegleg --cov-report html:cover --cov-report xml:cover/coverage.xml --cov-report term --cov-fail-under 84 tests/
57
+
50 58
 [testenv:venv]
51 59
 commands = {posargs}
52 60
 

Loading…
Cancel
Save