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

Run cov in src and not in tests #925

Closed
wants to merge 3 commits into from
Closed

Run cov in src and not in tests #925

wants to merge 3 commits into from

Conversation

osanseviero
Copy link
Contributor

@osanseviero osanseviero commented Jun 23, 2022

[do not review yet]

Cov was just looking at coverage in tests, meaning that it was complaining that our tests were not tested. See the diff with this PR
https://app.codecov.io/gh/huggingface/huggingface_hub/compare/925/overview.

Example issues from past few days

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@osanseviero
Copy link
Contributor Author

I'm not sure if codecov works for us. Our tests don't do relative import, they pip install huggingface_hub and then run the tests, and I think that confused codecov as it does not know what is being tested

@osanseviero
Copy link
Contributor Author

So for example, locally

pytest --cov=src/huggingface_hub  ./tests/test_utils_sha.py

Gives me

----------- coverage: platform linux, python 3.9.7-final-0 -----------
Name                                              Stmts   Miss  Cover
---------------------------------------------------------------------
src/huggingface_hub/__init__.py                      37     37     0%
src/huggingface_hub/_commit_api.py                  114    114     0%
src/huggingface_hub/_snapshot_download.py            62     62     0%
src/huggingface_hub/commands/__init__.py             10     10     0%
src/huggingface_hub/commands/huggingface_cli.py      16     16     0%
src/huggingface_hub/commands/lfs.py                  73     73     0%
src/huggingface_hub/commands/user.py                166    166     0%
src/huggingface_hub/constants.py                     32     32     0%
src/huggingface_hub/fastai_utils.py                 102    102     0%
src/huggingface_hub/file_download.py                318    318     0%
src/huggingface_hub/hf_api.py                       654    654     0%
src/huggingface_hub/hub_mixin.py                     87     87     0%
src/huggingface_hub/inference_api.py                 34     34     0%
src/huggingface_hub/keras_mixin.py                  136    136     0%
src/huggingface_hub/lfs.py                          157    157     0%
src/huggingface_hub/repocard.py                      88     88     0%
src/huggingface_hub/repocard_types.py                37     37     0%
src/huggingface_hub/repository.py                   579    579     0%
src/huggingface_hub/snapshot_download.py              4      4     0%
src/huggingface_hub/utils/__init__.py                 2      2     0%
src/huggingface_hub/utils/_deprecation.py            27     27     0%
src/huggingface_hub/utils/_errors.py                 25     25     0%
src/huggingface_hub/utils/_fixes.py                   7      7     0%
src/huggingface_hub/utils/_subprocess.py              8      8     0%
src/huggingface_hub/utils/endpoint_helpers.py        93     93     0%
src/huggingface_hub/utils/logging.py                 53     53     0%
src/huggingface_hub/utils/sha.py                     14     14     0%
---------------------------------------------------------------------
TOTAL                                              2935   2935     0%

@Wauplin
Copy link
Contributor

Wauplin commented Aug 11, 2022

I close without merging since it's outdated. The problem is properly listed in issue #977.

@Wauplin Wauplin closed this Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants