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

Enable branch = true for coverage.run #2452

Closed
Kludex opened this issue Jan 31, 2024 · 15 comments · Fixed by #2825
Closed

Enable branch = true for coverage.run #2452

Kludex opened this issue Jan 31, 2024 · 15 comments · Fixed by #2825
Labels
good first issue Good for beginners

Comments

@Kludex
Copy link
Member

Kludex commented Jan 31, 2024

The goal here is to enable branch = true on tool.coverage.run. We want to be able to cover all logic paths.

@Kludex Kludex added the good first issue Good for beginners label Jan 31, 2024
ShreySinha02 added a commit to ShreySinha02/starlette that referenced this issue Feb 15, 2024
@ShreySinha02
Copy link

ShreySinha02 commented Feb 15, 2024

opened #2513

@ShreySinha02
Copy link

can not pass on --fail-under=100 but on 99 it can pass the the coverage

@Kludex
Copy link
Member Author

Kludex commented Feb 15, 2024

Well, the goal is exactly to add tests...

@TechNiick
Copy link
Contributor

There was already a PR open for this issue here.
I have started to work on test coverage. The first PR was opened here.
After merging this first one I will continue with the rest of them.

@hoenie-ams
Copy link

Fund with Polar

FYI @Kludex : The link doesn't work (404)

@Kludex
Copy link
Member Author

Kludex commented Dec 4, 2024

Fund with Polar

FYI @Kludex : The link doesn't work (404)

We are not using polar. They don't remove the links after you remove the integration.

@lealre
Copy link
Contributor

lealre commented Dec 12, 2024

Putting the table to make it easier to identify:

Name Branch BrPart Cover Missing
starlette/_utils.py 14 1 98% 78->82
starlette/middleware/gzip.py 22 2 98% 16->22, 91->exit
starlette/requests.py 96 3 99% 114->116, 233->225, 253->278
starlette/routing.py 164 3 99% 199->202, 401->430, 484->496
TOTAL 2016 9 99%

Let me know if there is any inconsistency in it.

@Kludex
Copy link
Member Author

Kludex commented Dec 25, 2024

Very few missing now:

+ venv/bin/coverage report --show-missing --skip-covered --fail-under=100
Name                           Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------
starlette/_utils.py               50      0     14      1    98%   78->82
starlette/middleware/gzip.py      82      0     22      2    98%   16->22, 91->exit
starlette/requests.py            201      0     96      3    99%   114->116, 233->225, 253->278
starlette/routing.py             471      0    164      3    99%   199->202, 401->430, 484->496
--------------------------------------------------------------------------
TOTAL                           9240      0   2016      9    99%

Nice! Thanks @lealre for the help here. :)

@Kludex
Copy link
Member Author

Kludex commented Dec 28, 2024

Thanks for the help here @lealre 🙏

@Kludex Kludex closed this as completed Dec 28, 2024
@Kludex
Copy link
Member Author

Kludex commented Dec 28, 2024

Ups... I think it's not finished yet 👀

@lealre
Copy link
Contributor

lealre commented Dec 28, 2024

Glad I could help here 👍

Ups... I think it's not finished yet 👀

Was it not possible to set branch=True because coverage fails in Python versions earlier than 3.9, or is it something else?

@Kludex Kludex reopened this Dec 28, 2024
@Kludex
Copy link
Member Author

Kludex commented Dec 28, 2024

Yes. 😔

@Kludex
Copy link
Member Author

Kludex commented Dec 28, 2024

This issue is only on 3.9 now. Do you know why?

@Kludex
Copy link
Member Author

Kludex commented Dec 28, 2024

@Kludex
Copy link
Member Author

Kludex commented Dec 28, 2024

Let's change the scripts/test to only run --branch on higher than Python 3.10, and remove this custom logic when we drop 3.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for beginners
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants