From 3be3141ba6e31538a6b17b1d990393097666c317 Mon Sep 17 00:00:00 2001 From: Mitchell Young Date: Tue, 5 Nov 2019 13:00:36 -0800 Subject: [PATCH 1/3] Add coverage env to tox.ini --- tox.ini | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 562e4a7c04..feeac63106 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,lint +envlist = py36,py37,lint,cov [testenv] basepython = {env:PYTHON3_PATH:python3} @@ -9,9 +9,25 @@ deps= setenv = PYTHONPATH = {toxinidir} commands = - pytest {posargs} armi + pytest {posargs} armi -[testenv:pylint] +[testenv:cov] +commands = + pytest --cov=armi {posargs} armi + +[testenv:lint] ignore_errors = true commands = - pylint armi --rcfile={toxinidir}/pylintrc + +[testenv:report] +deps = coverage +skip_install = true +command = + coverage report + coverage html + +[testenv:clean] +deps = coverage +skip_install = true +commands = coverage erase From 453225b6792689798724e9dd054caa57d7b21b81 Mon Sep 17 00:00:00 2001 From: Mitchell Young Date: Tue, 5 Nov 2019 13:28:38 -0800 Subject: [PATCH 2/3] Add coverage to Travis config --- .travis.yml | 4 +++- tox.ini | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce0399c28f..4f55ea00e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ matrix: env: TOXENV=py37 - python: "3.7" env: TOXENV=lint + - python: "3.7" + env: TOXENV=report cache: directories: @@ -17,4 +19,4 @@ cache: install: pip install -U tox coveralls language: python script: tox -after_success: coveralls \ No newline at end of file +after_success: coveralls diff --git a/tox.ini b/tox.ini index feeac63106..dfc615d792 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,lint,cov +envlist = py36,py37,lint,cov,report [testenv] basepython = {env:PYTHON3_PATH:python3} @@ -21,7 +21,7 @@ commands = - pylint armi --rcfile={toxinidir}/pylintrc [testenv:report] -deps = coverage +deps = cov skip_install = true command = coverage report From 9f8b8be8c6dacec37e10745123f63beff85433b2 Mon Sep 17 00:00:00 2001 From: Mitchell Young Date: Tue, 5 Nov 2019 13:47:49 -0800 Subject: [PATCH 3/3] Fix tox dependencies --- tox.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index dfc615d792..95cef69970 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,9 @@ commands = pytest {posargs} armi [testenv:cov] +deps= + -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements-testing.txt commands = pytest --cov=armi {posargs} armi @@ -21,11 +24,12 @@ commands = - pylint armi --rcfile={toxinidir}/pylintrc [testenv:report] -deps = cov skip_install = true command = coverage report coverage html +depends = + cov [testenv:clean] deps = coverage