Skip to content

chore: add Python tests and scaffolding for coverage reporting#51

Merged
sergioramos merged 9 commits into
mainfrom
46-setup-testing-and-coverage-reports-for-python
May 31, 2023
Merged

chore: add Python tests and scaffolding for coverage reporting#51
sergioramos merged 9 commits into
mainfrom
46-setup-testing-and-coverage-reports-for-python

Conversation

@gjreda

@gjreda gjreda commented May 26, 2023

Copy link
Copy Markdown
Collaborator

This adds the necessary scaffolding for running tests and generating code coverage reports for the Python sidecar.

We should also automate code coverage reporting as part of #63 (cc @sehyod I'm happy to help with this if you'd like).

$ poetry run pytest --cov=python python/tests
============================================================================================================================ test session starts =============================================================================================================================
platform darwin -- Python 3.10.11, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/greg/Dropbox/refstudio
plugins: cov-4.1.0
collected 5 items

python/tests/test_ingest.py .                                                                                                                                                                                                                                          [ 20%]
python/tests/test_shared.py ....                                                                                                                                                                                                                                       [100%]

--------- coverage: platform darwin, python 3.10.11-final-0 ----------
Name                         Stmts   Miss  Cover
------------------------------------------------
python/main.py                  25     25     0%
python/sidecar/__init__.py       0      0   100%
python/sidecar/ingest.py       130     21    84%
python/sidecar/shared.py        32      0   100%
python/sidecar/typing.py        27      0   100%
------------------------------------------------
TOTAL                          214     46    79%

@gjreda gjreda requested review from cguedes, sehyod and sergioramos May 30, 2023 19:06
@gjreda gjreda marked this pull request as ready for review May 30, 2023 19:07
@gjreda gjreda changed the title Adding scaffolding for pytest and coverage reporting Adding some tests and scaffolding for coverage reporting May 30, 2023
cguedes
cguedes previously approved these changes May 31, 2023
sehyod
sehyod previously approved these changes May 31, 2023

@sehyod sehyod left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for that! I will work on adding this to the CI workflow as soon as this branch has been merged.
When trying the branch locally, I noticed it created a few files, in __pycache__ folders, and the resulting .coverage file. Would it make sense to add these to .gitignore so we don't accidentally push them? Or do we want to have them in the repo?

@gjreda gjreda dismissed stale reviews from sehyod and cguedes via e58e437 May 31, 2023 18:59
@gjreda

gjreda commented May 31, 2023

Copy link
Copy Markdown
Collaborator Author

@sehyod yes, good catch! I always forget to do this because I have all of these files ignored for all my projects in ~/.gitignore_global, but I've updated our ignored files.

@gjreda gjreda requested review from cguedes and sehyod May 31, 2023 19:00
@sergioramos sergioramos changed the title Adding some tests and scaffolding for coverage reporting chore: add Python tests and scaffolding for coverage reporting May 31, 2023
@sergioramos sergioramos merged commit b7c9176 into main May 31, 2023
@sergioramos sergioramos deleted the 46-setup-testing-and-coverage-reports-for-python branch May 31, 2023 20:39
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.

4 participants