From 54bddd5b9fdfeb5d2fa9a2620ad6a38623ff1158 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 25 Jan 2024 23:47:58 +0900 Subject: [PATCH] Use .coveragerc to omit directories We can use the omit option instead of adding --omit argument, so that we can run coverage commands outside of tox easily. Also this fixes the inconsistent omit used in some coverage commands in tox. Change-Id: I1efa406401c2e8a6b705daef4921b2dec7d55f2e --- .coveragerc | 3 +++ tox.ini | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index 46ab3f7e..f96dfd86 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,9 @@ [run] branch = True source = ovn_bgp_agent +omit = ovn_bgp_agent/tests/*, + ovn_bgp_agent/privileged/linux_net.py, + ovn_bgp_agent/utils/linux_net.py [report] ignore_errors = True diff --git a/tox.ini b/tox.ini index 31b3e14d..43a5f21b 100644 --- a/tox.ini +++ b/tox.ini @@ -38,9 +38,9 @@ setenv = commands = stestr run --exclude-regex ".tests.functional" {posargs} coverage combine - coverage html -d cover --omit='ovn_bgp_agent/tests/*' - coverage xml -o cover/coverage.xml --omit='ovn_bgp_agent/tests/*' - coverage report --fail-under=82 --skip-covered --omit='ovn_bgp_agent/tests/*,ovn_bgp_agent/privileged/linux_net.py,ovn_bgp_agent/utils/linux_net.py' + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report --fail-under=82 --skip-covered [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt