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

Add coverage report to the GitHub Actions summary #20

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

zerolab
Copy link
Contributor

@zerolab zerolab commented Dec 20, 2023

* uses `python -Im`
* DRY for latest python version (`PYTHON_LATEST`)
* pass a view env vars
@zerolab
Copy link
Contributor Author

zerolab commented Dec 20, 2023

Note that with #19, the coverage report is more complete.

report
~ ❯❯❯ coverage report
Name                                      Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------------------------
src/django_nh3/__init__.py                    0      0      0      0   100%
src/django_nh3/apps.py                        5      0      0      0   100%
src/django_nh3/forms.py                      18      0      4      0   100%
src/django_nh3/models.py                     29      3      6      0    86%   45-59
src/django_nh3/templatetags/__init__.py       0      0      0      0   100%
src/django_nh3/templatetags/nh3_tags.py      16      0      6      0   100%
src/django_nh3/utils.py                      19      0     10      0   100%
tests/__init__.py                             0      0      0      0   100%
tests/constants.py                            3      0      0      0   100%
tests/migrations/0001_initial.py              6      0      0      0   100%
tests/migrations/__init__.py                  0      0      0      0   100%
tests/settings.py                            15      0      0      0   100%
tests/test_forms.py                          13      0      4      0   100%
tests/test_models.py                         44      0      4      0   100%
tests/test_settings.py                       17      0      6      0   100%
tests/test_templatetags.py                   18      0      0      0   100%
tests/urls.py                                 3      3      0      0     0%   1-5
-------------------------------------------------------------------------------------
TOTAL                                       206      6     40      0    97%

@marksweb
Copy link
Owner

Should probably exclude the tests module from coverage. It's only worth tracking the test coverage of the app itself I think 🤔

@zerolab
Copy link
Contributor Author

zerolab commented Dec 20, 2023

@marksweb the coverage docs recommend that tests are included and links to https://nedbatchelder.com/blog/202008/you_should_include_your_tests_in_coverage.html

@@ -33,8 +41,8 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade 'tox>=4.0.0rc3'
python -Im pip install --upgrade pip setuptools wheel
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there's another I'm not in the habbit of using.

Copy link
Owner

@marksweb marksweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love these improvements! Now I need to spread them around all my other projects!!

@marksweb marksweb merged commit 508a2d8 into marksweb:main Dec 20, 2023
5 checks passed
@zerolab zerolab deleted the chore/coverage-report branch December 20, 2023 23:44
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.

2 participants