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

Increase test coverage to above 90% #2

Open
jagmoreira opened this issue Sep 28, 2022 · 8 comments
Open

Increase test coverage to above 90% #2

jagmoreira opened this issue Sep 28, 2022 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@jagmoreira
Copy link
Collaborator

jagmoreira commented Sep 28, 2022

Problem

Forge v1.0.0 had 41% overall test coverage. We should increase that so we can be more confident about preventing some types of bugs!

This issue is a "meta-issue" tracking improvements to Forge's unittest coverage.

Goal

Get test coverage above 90%!

How can you help?

  1. Create a PR that adds/improves unittests for a few functions.
  2. Link the PR to this issue so the work can be properly tracked.
  3. Rinse, repeat!

Please do not create a large PR with tests for a lot of code at once, unless it's a small module like rsync.py or ssh.py but otherwise we welcome all contributions that follow our guidelines!

Current progress (2022-10-26)

Version 1.0.1:

Name                       Stmts   Miss  Cover   
-------------------------------------------------
src/forge/__init__.py          4      0   100%
src/forge/cleanup.py          35     21    40%
src/forge/common.py          187     99    47%
src/forge/configure.py        56     39    30%
src/forge/create.py          346    269    22%
src/forge/destroy.py          75     57    24%
src/forge/engine.py           18      4    78%
src/forge/main.py             95     41    57%
src/forge/parser.py           72     19    74%
src/forge/rsync.py            62      1    98%
src/forge/run.py              77      7    91%
src/forge/ssh.py              44      0   100%
src/forge/start.py            53     39    26%
src/forge/stop.py             53     38    28%
src/forge/yaml_loader.py     102     1    99%
-------------------------------------------------
TOTAL                       1279    635    50%
@jagmoreira jagmoreira added enhancement New feature or request good first issue Good for newcomers hacktoberfest labels Sep 28, 2022
@donheshanthaka
Copy link
Contributor

Hey there, can you assign me for this issue. i would be happy to help you on this project.

@Macr0Nerd
Copy link
Collaborator

@donheshanthaka Assigned you the issue, if you have any questions feels free to ask!

@jagmoreira
Copy link
Collaborator Author

@donheshanthaka thanks for volunteering!
Do you mind dropping a comment here saying which function(s) you're planning on writing tests for?
We are thinking of breaking this issue down into separate ones for each module.

@donheshanthaka
Copy link
Contributor

hey there, can you give me a little bit of time, i'll go through the codebase and let you know.

@donheshanthaka
Copy link
Contributor

@jagmoreira
Hey there, since you have created separate issues feel free to close to this one if you want, i will contribute to individual ones as i'm doing them. In the meantime i was able to fix the normalize_config split. i will make a PR for that on Oct 1st. i have left a comment on that issue. Thank you.

@jagmoreira
Copy link
Collaborator Author

jagmoreira commented Sep 30, 2022

Hey @donheshanthaka that's awesome! I assigned #12 to you already 💯

We will leave this issue open as a "meta-issue" to track the overall coverage process.
Once you feel comfortable feel free to leave a comment in whatever testing issue(s) you are working on and one of us will assign it to you. Happy Hacktoberfest!

@Alig1493
Copy link
Contributor

Could you point to the instructions that will help me generate the missing coverage report if there are still missing coverages? Thanks

@jagmoreira
Copy link
Collaborator Author

@Alig1493 yes we are still very short of our goal.
We don't have written instructions yet but if you can install the package locally (with test optional dependencies) it should work:

# Assuming you are at the root of the project's directory
pip install .[test]
pytest

It runs the test and shows a detailed coverage report with the lines missing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants