Skip to content

Commit

Permalink
tests: add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonkarlitskaya committed Jul 1, 2022
1 parent 5a1a07a commit 1d52e78
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,28 @@ jobs:
run: |
if type apt >/dev/null 2>&1; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-dbusmock libsystemd0 python3-pytest tox
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libsystemd0 \
python3-coverage \
python3-dbusmock \
python3-pytest \
tox
elif grep -q platform:el8 /etc/os-release; then
dnf install -y python3-pip systemd-libs
pip3 install python-dbusmock pytest tox
dnf install -y \
python3-pip \
systemd-libs
pip3 install \
coverage \
pytest \
python-dbusmock \
tox
else
dnf install -y python3-dbusmock systemd-libs pytest tox
dnf install -y \
pytest \
python3-coverage \
python3-dbusmock \
systemd-libs \
tox
fi
- name: Run tests
Expand Down Expand Up @@ -61,5 +77,10 @@ jobs:
arch: ${{ matrix.arch }}
install: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-dbusmock libsystemd0 python3-pytest tox
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libsystemd0 \
python3-coverage \
python3-dbusmock \
python3-pytest \
tox
run: tox -- -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.coverage
/.tox/

__pycache__/
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ envlist = site
[testenv]
deps=
coverage
pytest
python-dbusmock
commands = python3 -m pytest {posargs}
commands =
python3 -m coverage erase
python3 -m coverage run --source systemd_ctypes --module pytest {posargs}
python3 -m coverage report --skip-covered --fail-under=85 --show-missing
[testenv:site]
sitepackages = true
Expand Down

0 comments on commit 1d52e78

Please sign in to comment.