Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: set branch code coverage in pyproject.toml #438

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
&& python3 -m coverage xml -o coverage-setup.xml
- name: Run unit and integration tests
run: >
python3 -m pytest -ra --cov=$(pwd) --cov-branch --cov-report=xml
python3 -m pytest -ra --cov=$(pwd) --cov-report=xml
--durations=0 tests/unit/ tests/integration/
- name: Upload coverage
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
WORKDIR=$(mktemp -d -t apport.XXXXXXXXXX)
&& cp -r tests "$WORKDIR"
&& cd "$WORKDIR"
&& python3 -m pytest -ra --cov=$(pwd) --cov-branch --cov-report=xml
&& python3 -m pytest -ra --cov=$(pwd) --cov-report=xml
--durations=0 tests/unit/ tests/integration/
&& cd -
&& cp "$WORKDIR/coverage.xml" .
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
- uses: actions/checkout@v4
- name: Run all tests (to check if they are skipped or succeed)
run: >
SKIP_ONLINE_TESTS=1 python3 -m pytest -ra --cov=$(pwd) --cov-branch
SKIP_ONLINE_TESTS=1 python3 -m pytest -ra --cov=$(pwd)
--cov-report=xml --durations=0 tests/
- name: Upload coverage
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
env:
GDK_BACKEND: x11
run: >
xvfb-run python3 -m pytest -ra --cov=$(pwd) --cov-branch
xvfb-run python3 -m pytest -ra --cov=$(pwd)
--cov-report=xml --durations=0 tests/system/
- name: Stop D-Bus daemon
run: kill $(cat /run/dbus/pid)
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
WORKDIR=$(mktemp -d -t apport.XXXXXXXXXX)
&& cp -r tests "$WORKDIR"
&& cd "$WORKDIR"
&& sudo xvfb-run python3 -m pytest -ra --cov=$(pwd) --cov-branch
&& sudo xvfb-run python3 -m pytest -ra --cov=$(pwd)
--cov-report=xml --durations=0 tests/system/
&& cd -
&& cp "$WORKDIR/coverage.xml" .
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ reports = false
# Activate the evaluation score.
score = false

[tool.pytest.ini_options]
addopts = "--cov-branch"

[tool.ruff]
include = [
"pyproject.toml",
Expand Down
Loading