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

Fix: Omit tests directory from code coverage #735

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ coverage:
precision: 1
round: up

ignore:
- "tests/*"

status:
project:
default:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,19 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade "tox<4"
python -m pip install --upgrade smokeshow

- name: Run ${{ matrix.tool }}
run: tox -e ${{ matrix.tool }}

- name: Upload coverage
if: ${{ matrix.tool == 'mypy' }}
uses: codecov/codecov-action@v4
with:
flags: mypy
- name: Upload mypy coverage
run: |
smokeshow upload mypy_report
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: MyPy Coverage
# SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 90
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}

check-changelog:
name: Check for news fragments in 'changelog.d/'
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ hiredis = redis[hiredis]>=4.0.2

[coverage:run]
omit =
tests/*,
*/tests/*

[coverage:report]
precision = 1
skip_covered = true
omit =
*/tests/*

[tox:tox]
minversion = 3.15.0
Expand Down Expand Up @@ -115,7 +117,7 @@ envdir={toxworkdir}/lint
commands =
black: black --target-version py36 {posargs:--check --diff} setup.py django_redis/ tests/
ruff: ruff {posargs:check --show-fixes} django_redis/ tests/
mypy: mypy {posargs:--cobertura-xml-report .} django_redis tests
mypy: mypy {posargs:--html-report mypy_report} django_redis tests
deps =
black
django-stubs
Expand Down
Loading