From be893a9f5155475d821a95bfacedf1e482b2a3f0 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Fri, 5 Jun 2015 11:44:19 +0100 Subject: [PATCH] Add tox targets for coverage testing. These will require a minimum of 90% coverage to pass. Also remove unnecessary 'deps = {[testenv]deps}' lines; all [testenv:*] targets use the values in [testenv] for any missing configuration options. Change-Id: Ifa311965c0329ce406cfb9e44660240574dacb4a --- test-requirements.txt | 1 + tox.ini | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 8dedde52..c5d12656 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,3 +12,4 @@ oslosphinx # For style checking hacking<0.11,>=0.10.0 +coverage diff --git a/tox.ini b/tox.ini index 72fd1082..cfaf711f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -minversion = 1.6 +minversion = 2.0 skipsdist = True -envlist = py27, py34, docs, pep8 +envlist = py27, py34, docs, pep8, {py27,py34}-coverage [tox:jenkins] downloadcache = ~/cache/pip @@ -15,16 +15,19 @@ deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = nosetests {posargs} +[testenv:py27-coverage] +commands = nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-inclusive --cover-html {posargs} + +[testenv:py34-coverage] +commands = nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-inclusive --cover-html {posargs} + [testenv:pep8] -deps = {[testenv]deps} commands = flake8 {posargs} [testenv:docs] -deps = {[testenv]deps} commands = python setup.py build_sphinx [testenv:venv] -deps = {[testenv]deps} commands = {posargs} [flake8]