Fix tox configuration for coverage
[dcaegen2/platform/plugins.git] / cdap / cdapplugin / tox-local.ini
index 1664561..d14c8a1 100644 (file)
@@ -1,11 +1,30 @@
+# tox -c tox-local.ini
 [tox]
-envlist = py27,py36
+envlist = py27,py36,cov
 
 [testenv]
+# coverage can only find modules if pythonpath is set
+setenv=
+    PYTHONPATH={toxinidir}
+    COVERAGE_FILE=.coverage.{envname}
 deps=
     -rrequirements.txt
     pytest
     coverage
     pytest-cov
 commands=
-    pytest --cov {envsitepackagesdir}/cdapcloudify  --cov-report html
+    coverage erase
+    pytest --junitxml xunit-results.{envname}.xml --cov cdapcloudify
+
+[testenv:cov]
+skip_install = true
+deps=
+    coverage
+setenv=
+    COVERAGE_FILE=.coverage
+commands=
+    coverage combine
+    coverage html
+
+[pytest]
+junit_family = xunit2