jenkins-bot has submitted this change and it was merged.

Change subject: tox env to build test coverage
......................................................................


tox env to build test coverage

The python module `coverage` let you easily generate coverage report. We
are using it for the mediawiki/tools/scap repository already.

Add a tox env `cover` which uses `coverage run python setup.py test` to
capture the output. Then generate a text and HTML reports (under
/htmlcov).

The new env is not invoked by default, one have to:

 tox -ecover

Then open htmlcov/index.html

Change-Id: Ia94d53be8a90ef50b3bf98c405e9c0994bc58c59
---
M .gitignore
M tox.ini
2 files changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitignore b/.gitignore
index 3984a94..a19910e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 pybal.egg-info
 *.pyc
 .tox
+/.coverage
+/htmlcov
diff --git a/tox.ini b/tox.ini
index fb238e6..a4077ce 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,6 +5,13 @@
 commands = {envpython} setup.py test
 deps = twisted
 
+[testenv:cover]
+commands = coverage run setup.py test
+           coverage report --omit=".tox*,tests/*,setup.py"
+           coverage html --omit=".tox*,tests/*,setup.py"
+deps = twisted
+       coverage
+
 [testenv:flake8]
 commands = flake8
 deps = flake8

-- 
To view, visit https://gerrit.wikimedia.org/r/172243
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia94d53be8a90ef50b3bf98c405e9c0994bc58c59
Gerrit-PatchSet: 3
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to