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 code coverage #16

Merged
merged 15 commits into from
Feb 1, 2024
Merged

Add code coverage #16

merged 15 commits into from
Feb 1, 2024

Conversation

pelletier
Copy link
Contributor

@pelletier pelletier commented Feb 1, 2024

Set up make coverage to report coverage, and fixed it to 100% on top of the #12 branch. Far from perfect, but helped me catch some edge cases I didn't test.

It uses coverage.py, which has a nice HTML interface:

image

As well as an in-console report:

(dispatch-sdk) ~/s/g/s/dispatch-sdk-python cov$ make coverage
python -m mypy src tests
Success: no issues found in 55 source files
coverage run -m unittest discover
....................................
----------------------------------------------------------------------
Ran 36 tests in 0.112s

OK
coverage html -d .coverage-html
Wrote HTML report to .coverage-html/index.html
coverage report
Name                                Stmts   Miss  Cover
-------------------------------------------------------
src/dispatch/__init__.py               74      0   100%
src/dispatch/coroutine.py             163      0   100%
src/dispatch/fastapi.py                62      0   100%
src/ring/__init__.py                    0      0   100%
src/ring/coroutine/__init__.py          0      0   100%
src/ring/coroutine/v1/__init__.py       0      0   100%
src/ring/record/__init__.py             0      0   100%
src/ring/record/v1/__init__.py          0      0   100%
src/ring/status/__init__.py             0      0   100%
src/ring/status/v1/__init__.py          0      0   100%
src/ring/task/__init__.py               0      0   100%
src/ring/task/v1/__init__.py            0      0   100%
-------------------------------------------------------
TOTAL                                 299      0   100%

It's not hooked up to CI. Just using it as a guidance tool.

@pelletier pelletier merged commit c46e254 into main Feb 1, 2024
2 checks passed
@pelletier pelletier deleted the cov branch February 1, 2024 03:12
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