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
16 changes: 16 additions & 0 deletions codecov.yml
Copy link
Member

@WisdomPill WisdomPill Feb 29, 2024

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?

Copy link
Author

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?

Copy link
Author

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.

Copy link
Member

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

Copy link
Author

@sauravsharma1998 sauravsharma1998 Feb 29, 2024

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.

Copy link
Author

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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
comment:
layout: "header, diff, flags, components"

flag_management:
individual_flags:
- name: tests
paths:
- django_redis/
statuses:
- type: project

- name: mypy
paths:
- django_redis/
statuses:
- type: project
4 changes: 3 additions & 1 deletion 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
Loading