-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
base: master
Are you sure you want to change the base?
Fix: Omit tests directory from code coverage #735
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #735 +/- ##
=========================================
+ Coverage 61.5% 89.4% +27.9%
=========================================
Files 43 22 -21
Lines 2786 1122 -1664
Branches 161 0 -161
=========================================
- Hits 1713 1002 -711
+ Misses 1060 120 -940
+ Partials 13 0 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
setup.cfg
Outdated
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_zlib {posargs} | ||
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_zstd {posargs} | ||
{envpython} -m pytest --cov-append --cov-report= --ds=settings.sqlite_gzip {posargs} | ||
{envpython} -m pytest -vv --ignore=tests/* --cov-report= --ds=settings.sqlite {posargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need these ignores?
setup.cfg
Outdated
@@ -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:--cobertura-xml-report .} django_redis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please restore this, as also tests should be checked for typing errors so that we can notice breaking changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @WisdomPill ! This was just experimental. Any suggestions to avoid tests directory from coverage report?
also changelog is missing |
@WisdomPill Added new config file codecov.yml to manage the coverage on the basis of flags and directory. Motivation - https://docs.codecov.com/docs/github-5b-setting-coverage-standards-with-flags Other way: |
we still need coverage on tests for mypy |
codecov.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not change the codecov in .github
folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WisdomPill Do we require to upload mypy report on coverage.io?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default coverage.io will merge all the coverages, that's why coverage percentage is lower than expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are using codecov, coverage.io does not exist as far as I know. I was asking why did you not change this file instead and created a new one.
And yes we need to upload the coverage of mypy too to codecov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got your point @WisdomPill !
With coverage.io I meant to https://app.codecov.io/
Could you provide any idea, Why mypy coverage is low? It would be helpful to think further in combining both type of reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MyPy's type checking does not fall under the category of code coverage.
Code coverage typically refers to the measurement of how much of your codebase is exercised by your test suite during execution. It's a metric that indicates the percentage of lines, branches, or other code elements that have been executed by your tests. Code coverage tools like coverage.py or JaCoCo track which parts of your code are executed during testing and generate reports to help you understand how thoroughly your tests exercise your code.
On the other hand, MyPy is a static type checker for Python code. It analyzes your codebase to identify potential type-related issues, inconsistencies, or violations of type hints. MyPy operates statically, meaning it analyzes the code without actually running it. Instead of measuring code coverage, MyPy focuses on ensuring type safety and correctness by enforcing type annotations and performing type inference.
@WisdomPill Please correct me if I am wrong.
@WisdomPill Instead of uploading mypy report to codecov.io we can generated html formatted report of mypy(Which will satisfy purposes for both code coverage and type checking coverage) mypy report can be published via smokeshow(https://smokeshow.helpmanual.io/) If it's okay for you, we can proceed. Else have to find another way. |
No description provided.