diff --git a/Jenkinsfile b/Jenkinsfile index 5c92305..e1f8c23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,12 @@ pipeline { sh 'tox -epep8' } } + stage('Coverage') { + agent any + steps { + sh 'tox -e coverage' + } + } stage('Integration') { agent any steps { diff --git a/requirements.txt b/requirements.txt index d7929ad..84620d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ mock six python-monascaclient==1.5.0 pytest +pytest-cov requests_mock kubernetes==8.0.0 flake8 diff --git a/tox.ini b/tox.ini index 81a9d1e..34dc222 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py37, pep8 +envlist = py37,pep8,coverage [testenv] usedevelop = True @@ -12,6 +12,13 @@ commands = py.test deps = -r{toxinidir}/requirements.txt +[testenv:coverage] +basepython = python3.7 +usedevelop = True +commands = py.test --cov=visualizer --cov=k8s-grafana --cov-report=term-missing visualizer/ k8s-grafana/ +deps = + -r{toxinidir}/requirements.txt + [testenv:pep8] commands = flake8 {posargs}