← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~powersj/cloud-init:coverage into cloud-init:master

 

Joshua Powers has proposed merging ~powersj/cloud-init:coverage into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/308975

Adds in coverage collections to cloud-init tox-based unit tests.
-- 
Your team cloud init development team is requested to review the proposed merge of ~powersj/cloud-init:coverage into cloud-init:master.
diff --git a/.gitignore b/.gitignore
index 77eb9c7..865cac1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ dist
 *.pyc
 __pycache__
 .tox
+.coverage
diff --git a/test-requirements.txt b/test-requirements.txt
index 6bf3894..0e7fc8f 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,6 +3,7 @@ httpretty>=0.7.1
 mock
 nose
 unittest2
+coverage
 
 # Only needed if you want to know the test times
 # nose-timer
diff --git a/tox.ini b/tox.ini
index 277858e..af6d67a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,9 @@ envlist = py27, py3, flake8, xenial
 recreate = True
 
 [testenv]
-commands = python -m nose {posargs:tests}
+commands = python -m nose \
+    {posargs:--with-coverage --cover-erase \
+        --cover-branches --cover-package=cloudinit --cover-inclusive}
 deps = -r{toxinidir}/test-requirements.txt
        -r{toxinidir}/requirements.txt
 setenv =

Follow ups