Skip to content

Commit

Permalink
Calculate coverage unittests (#667)
Browse files Browse the repository at this point in the history
* Collect coverage of checkbox-ng and update source .coveragerc

Minor: Sort and update exclusions

* Collect coverage of checkbox-support and update source .coveragerc

Minor: Sort and update exclusions

* New coveragerc for providers

* Collect coverage of providers bins

Minor: Always call python via the correct env name in tox

* Minor: Fixed rotated dependencies

* Show missing lines in cli report

Minor: Fixed spacing
  • Loading branch information
Hook25 authored Aug 18, 2023
1 parent 8d1089f commit 1c76d39
Show file tree
Hide file tree
Showing 20 changed files with 235 additions and 46 deletions.
23 changes: 11 additions & 12 deletions checkbox-ng/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
[run]
branch = True
source = checkbox_ng
source = checkbox_ng,plainbox
omit =
checkbox_ng/tests.py
checkbox_ng/test_*.py
plainbox/vendor/*
plainbox/test_*
checkbox_ng/test_*
plainbox/impl/test_*
plainbox/testing_utils/*
plainbox/impl/unit/test_*
checkbox_ng/launcher/test_*
plainbox/impl/secure/test_*
plainbox/impl/session/test_*
plainbox/impl/commands/test_*
plainbox/impl/exporter/test_*
plainbox/impl/integration_tests.py
plainbox/impl/secure/test_*
plainbox/impl/test_*
plainbox/impl/transport/test_*
plainbox/setup.py
plainbox/test_*
plainbox/testing_utils/test_*
plainbox/tests.py
plainbox/vendor/*

[report]
exclude_lines =
Expand All @@ -25,3 +23,4 @@ exclude_lines =
@public
pragma: no cover
raise NotImplementedError
show_missing = True
11 changes: 10 additions & 1 deletion checkbox-ng/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ commands =
{envpython} {envsitepackagesdir}/plainbox/impl/providers/categories/manage.py validate
{envpython} {envsitepackagesdir}/plainbox/impl/providers/exporters/manage.py validate
{envpython} {envsitepackagesdir}/plainbox/impl/providers/manifest/manage.py validate
{envpython} -m pytest
{envpython} -m coverage run -m pytest
{envpython} -m coverage report

[testenv:py35]
deps =
pytest
coverage == 5.5
pytest-cov == 2.12.1
requests == 2.9.1
urwid == 1.3.1
Jinja2 == 2.8
Expand All @@ -28,6 +31,8 @@ setenv=
[testenv:py36]
deps =
pytest
coverage == 5.5
pytest-cov == 3.0.0
requests == 2.18.4
urwid == 2.0.1
Jinja2 == 2.10
Expand All @@ -38,6 +43,8 @@ deps =
[testenv:py38]
deps =
pytest
coverage == 7.3.0
pytest-cov == 4.1.0
requests == 2.22.0
urwid == 2.0.1
Jinja2 == 2.10.1
Expand All @@ -48,6 +55,8 @@ deps =
[testenv:py310]
deps =
pytest
coverage == 7.3.0
pytest-cov == 4.1.0
requests == 2.25.1
urwid == 2.1.2
Jinja2 == 3.0.3
Expand Down
21 changes: 21 additions & 0 deletions checkbox-support/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[run]
branch = True
source = checkbox_support
omit =
checkbox_support/tests/*
checkbox_support/vendor/*
checkbox_support/parsers/tests/*
checkbox_support/scripts/tests/*
checkbox_support/snap_utils/tests/*
checkbox_support/heuristics/tests/*

[report]
exclude_lines =
@abc.abstractmethod
@abc.abstractproperty
@abstractmethod
@abstractproperty
@public
pragma: no cover
raise NotImplementedError
show_missing = True
11 changes: 10 additions & 1 deletion checkbox-support/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ isolated_build = True
commands =
{envpython} -m pip install .
{envpython} -m pip list
{envpython} -m pytest checkbox_support/
{envpython} -m coverage run -m pytest checkbox_support/
{envpython} -m coverage report

[testenv:py35]
deps =
pytest
coverage == 5.5
pytest-cov == 2.12.1
requests == 2.9.1
pyparsing == 2.0.3
distro == 1.0.1
Expand All @@ -25,6 +28,8 @@ setenv=
[testenv:py36]
deps =
pytest
coverage == 5.5
pytest-cov == 3.0.0
requests == 2.18.4
pyparsing == 2.2.0
distro == 1.0.1
Expand All @@ -34,6 +39,8 @@ deps =
[testenv:py38]
deps =
pytest
coverage == 7.3.0
pytest-cov == 4.1.0
requests == 2.22.0
pyparsing == 2.4.6
distro == 1.4.0
Expand All @@ -42,6 +49,8 @@ deps =
[testenv:py310]
deps =
pytest
coverage == 7.3.0
pytest-cov == 4.1.0
requests == 2.25.1
pyparsing == 2.4.7
distro == 1.7.0
Expand Down
16 changes: 16 additions & 0 deletions providers/base/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]
branch = True
source = bin,manage
omit =
tests/*

[report]
exclude_lines =
@abc.abstractmethod
@abc.abstractproperty
@abstractmethod
@abstractproperty
@public
pragma: no cover
raise NotImplementedError
show_missing = True
15 changes: 10 additions & 5 deletions providers/base/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ skipsdist=True
[testenv]
allowlist_externals = rm
commands =
pip -q install ../../checkbox-ng
{envpython} -m pip -q install ../../checkbox-ng
# Required because this provider depends on checkbox-support parsers & scripts
pip -q install ../../checkbox-support
{envpython} -m pip -q install ../../checkbox-support
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-resource.provider
# Required because this provider depends on the resource provider
{envbindir}/python3 ../resource/manage.py develop
{envbindir}/python3 manage.py validate
{envbindir}/python3 manage.py test
{envpython} ../resource/manage.py develop
{envpython} manage.py validate
{envpython} -m coverage run manage.py test
{envpython} -m coverage report

[testenv:py35]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.9.1
urwid == 1.3.1
Expand All @@ -36,6 +38,7 @@ setenv=
[testenv:py36]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.18.4
urwid == 2.0.1
Expand All @@ -50,6 +53,7 @@ deps =
[testenv:py38]
deps =
flake8
coverage == 7.3.0
natsort == 7.0.1
requests == 2.22.0
urwid == 2.0.1
Expand All @@ -64,6 +68,7 @@ deps =
[testenv:py310]
deps =
flake8
coverage == 7.3.0
natsort == 8.0.2
requests == 2.25.1
urwid == 2.1.2
Expand Down
16 changes: 16 additions & 0 deletions providers/certification-client/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]
branch = True
source = bin,manage
omit =
tests/*

[report]
exclude_lines =
@abc.abstractmethod
@abc.abstractproperty
@abstractmethod
@abstractproperty
@public
pragma: no cover
raise NotImplementedError
show_missing = True
13 changes: 9 additions & 4 deletions providers/certification-client/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ commands =
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-resource.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-base.provider
# Required because this provider depends on the resource and base providers
{envbindir}/python3 ../resource/manage.py develop
{envbindir}/python3 ../base/manage.py develop
{envbindir}/python3 manage.py validate
{envbindir}/python3 manage.py test
{envpython} ../resource/manage.py develop
{envpython} ../base/manage.py develop
{envpython} manage.py validate
{envpython} -m coverage run manage.py test
{envpython} -m coverage report

[testenv:py35]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.9.1
urwid == 1.3.1
Expand All @@ -36,6 +38,7 @@ setenv=
[testenv:py36]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.18.4
urwid == 2.0.1
Expand All @@ -50,6 +53,7 @@ deps =
[testenv:py38]
deps =
flake8
coverage == 7.3.0
natsort == 7.0.1
requests == 2.22.0
urwid == 2.0.1
Expand All @@ -64,6 +68,7 @@ deps =
[testenv:py310]
deps =
flake8
coverage == 7.3.0
natsort == 8.0.2
requests == 2.25.1
urwid == 2.1.2
Expand Down
16 changes: 16 additions & 0 deletions providers/certification-server/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]
branch = True
source = bin,manage
omit =
tests/*

[report]
exclude_lines =
@abc.abstractmethod
@abc.abstractproperty
@abstractmethod
@abstractproperty
@public
pragma: no cover
raise NotImplementedError
show_missing = True
13 changes: 9 additions & 4 deletions providers/certification-server/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ commands =
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-resource.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-base.provider
# Required because this provider depends on the resource and base providers
{envbindir}/python3 ../resource/manage.py develop
{envbindir}/python3 ../base/manage.py develop
{envbindir}/python3 manage.py validate
{envbindir}/python3 manage.py test
{envpython} ../resource/manage.py develop
{envpython} ../base/manage.py develop
{envpython} manage.py validate
{envpython} -m coverage run manage.py test
{envpython} -m coverage report

[testenv:py35]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.9.1
urwid == 1.3.1
Expand All @@ -36,6 +38,7 @@ setenv=
[testenv:py36]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.18.4
urwid == 2.0.1
Expand All @@ -50,6 +53,7 @@ deps =
[testenv:py38]
deps =
flake8
coverage == 7.3.0
natsort == 7.0.1
requests == 2.22.0
urwid == 2.0.1
Expand All @@ -64,6 +68,7 @@ deps =
[testenv:py310]
deps =
flake8
coverage == 7.3.0
natsort == 8.0.2
requests == 2.25.1
urwid == 2.1.2
Expand Down
10 changes: 7 additions & 3 deletions providers/docker/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ commands =
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-resource.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-base.provider
# Required because this provider depends on the resource and base providers
{envbindir}/python3 ../resource/manage.py develop
{envbindir}/python3 ../base/manage.py develop
{envbindir}/python3 manage.py validate
{envpython} ../resource/manage.py develop
{envpython} ../base/manage.py develop
{envpython} manage.py validate

[testenv:py35]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.9.1
urwid == 1.3.1
Expand All @@ -35,6 +36,7 @@ setenv=
[testenv:py36]
deps =
flake8
coverage == 5.5
natsort == 4.0.3
requests == 2.18.4
urwid == 2.0.1
Expand All @@ -49,6 +51,7 @@ deps =
[testenv:py38]
deps =
flake8
coverage == 7.3.0
natsort == 7.0.1
requests == 2.22.0
urwid == 2.0.1
Expand All @@ -63,6 +66,7 @@ deps =
[testenv:py310]
deps =
flake8
coverage == 7.3.0
natsort == 8.0.2
requests == 2.25.1
urwid == 2.1.2
Expand Down
16 changes: 16 additions & 0 deletions providers/gpgpu/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]
branch = True
source = bin,manage
omit =
tests/*

[report]
exclude_lines =
@abc.abstractmethod
@abc.abstractproperty
@abstractmethod
@abstractproperty
@public
pragma: no cover
raise NotImplementedError
show_missing = True
Loading

0 comments on commit 1c76d39

Please sign in to comment.