summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-05-26 09:37:26 +0100
committerBenjamin Schubert <contact@benschubert.me>2019-05-29 19:47:57 +0100
commit4e9b5803e7241cc87c14126d320dc744ac4798cf (patch)
tree1f1d3bc9756b70a49defe57e73bdd3f4940504fe /tox.ini
parentd220c4c3bcf31b9d4660a6e915e70269c891bd9f (diff)
downloadbuildstream-4e9b5803e7241cc87c14126d320dc744ac4798cf.tar.gz
Introduce Cython to the project and document
Cython requires a plugin to allow coverage of cython files, which was updated in coveragerc. It also means we need to build the dependencies and install cython for coverage. Cython requires access to both source and compiled files when running coverage. We therefore need to install project in develop mode. Updated documentation to explain how to run tests without tox but with coverage
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini14
1 files changed, 13 insertions, 1 deletions
diff --git a/tox.ini b/tox.ini
index 0a269c17d..94e96d9b0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -12,6 +12,10 @@ isolated_build = true
# Anything specified here is inherited by the sections
#
[testenv]
+usedevelop =
+ # This is required by Cython in order to get coverage for cython files.
+ py{35,36,37}-!nocover: True
+
commands =
# Running with coverage reporting enabled
py{35,36,37}-!external-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
@@ -52,6 +56,8 @@ setenv =
py{35,36,37}: XDG_CACHE_HOME = {envtmpdir}/cache
py{35,36,37}: XDG_CONFIG_HOME = {envtmpdir}/config
py{35,36,37}: XDG_DATA_HOME = {envtmpdir}/share
+ # This is required to get coverage for Cython
+ py{35,36,37}-!nocover: BST_CYTHON_TRACE = 1
whitelist_externals =
py{35,36,37}:
@@ -62,7 +68,9 @@ whitelist_externals =
# Coverage reporting
#
[testenv:coverage]
-skip_install = true
+# This is required by Cython in order to get coverage for cython files.
+usedevelop = True
+
commands =
coverage combine --rcfile={toxinidir}/.coveragerc {toxinidir}/.coverage-reports/
coverage html --rcfile={toxinidir}/.coveragerc --directory={toxinidir}/.coverage-reports/
@@ -76,6 +84,10 @@ setenv =
# Running linters
#
[testenv:lint]
+commands_pre =
+ # Build C extensions to allow Pylint to analyse them
+ {envpython} setup.py build_ext --inplace
+
commands =
pycodestyle
pylint src/buildstream tests