You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:01:13 UTC
[buildstream] 03/05: tox.ini: Support running tests without
coverage present at all
This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch tristan/optional-coverage-test
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit f5d0a4227b7047a242130f3a1c060f197e8ebf99
Author: Tristan Van Berkom <tr...@codethink.co.uk>
AuthorDate: Wed Feb 27 23:14:58 2019 +0900
tox.ini: Support running tests without coverage present at all
This change simply makes it possible to run the tests without
coverage and without any coverage related dependencies present
in the tox venvs.
To run tests without coverage, simply choose the python version
and append "-nocover" to the env name, e.g.:
tox -e py36-nocover
---
tox.ini | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/tox.ini b/tox.ini
index a54dc55..78e4919 100644
--- a/tox.ini
+++ b/tox.ini
@@ -12,14 +12,20 @@ skip_missing_interpreters = true
#
[testenv]
commands =
- pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
- - mkdir -p .coverage-reports
- - mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
+ # Running with coverage reporting enabled
+ py{35,36,37}-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
+ py{35,36,37}-!nocover: mkdir -p .coverage-reports
+ py{35,36,37}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
+
+ # Running with coverage reporting disabled
+ py{35,36,37}-nocover: pytest --basetemp {envtmpdir} {posargs}
deps =
- -rrequirements/requirements.txt
- -rrequirements/dev-requirements.txt
- -rrequirements/cov-requirements.txt
- -rrequirements/plugin-requirements.txt
+ py{35,36,37}: -rrequirements/requirements.txt
+ py{35,36,37}: -rrequirements/dev-requirements.txt
+ py{35,36,37}: -rrequirements/plugin-requirements.txt
+
+ # Only require coverage and pytest-cov when using it
+ !nocover: -rrequirements/cov-requirements.txt
passenv =
BST_FORCE_BACKEND
GI_TYPELIB_PATH