Fix tox configuration for coverage
[dcaegen2/platform/plugins.git] / dcae-policy / tox-local.ini
index d3ffbb0..125233e 100644 (file)
@@ -1,8 +1,12 @@
-# tox -c tox-local.ini | tee -a logs/test_dcaepolicyplugin.log 2>&1
+# 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
@@ -10,7 +14,20 @@ deps=
     pytest-cov
 whitelist_externals=
     /bin/mkdir
-# recreate = True
 commands=
     mkdir -p logs
-    pytest -v --cov dcaepolicyplugin --cov-report html
+    coverage erase
+    pytest --junitxml xunit-results.{envname}.xml --cov dcaepolicyplugin
+
+[testenv:cov]
+skip_install = true
+deps=
+    coverage
+setenv=
+    COVERAGE_FILE=.coverage
+commands=
+    coverage combine
+    coverage html
+
+[pytest]
+junit_family = xunit2