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

FR: Improve Test Coverage: A Test Plan #1754

Closed
bigtedde opened this issue Jul 18, 2023 · 11 comments
Closed

FR: Improve Test Coverage: A Test Plan #1754

bigtedde opened this issue Jul 18, 2023 · 11 comments
Labels
status:stale This item will be closed soon due to inactivity

Comments

@bigtedde
Copy link
Collaborator

The problem

Vorta's test coverage is currently 72% according to the coverage tool. I would like to increase that coverage to 80% or higher by parameterizing some of the current tests, as well as creating additional unit tests.

Requested Solution

pytest --cov=vorta --cov-report term-missing

This command yields a coverage report detailing the current code coverage of 72% as well as the lines in each file that are being missed by the current set of tests. Using this coverage report, I created a simple spreadsheet detailing all files with a code coverage of <70% and the areas of opportunity for additional tests. These files offer the greatest opportunity to increase code coverage, specifically through unit testing of currently untested functions/methods.

image

Additional context

@jetchirag is currently working with the test suite on issues #1716 and #1711, so I will wait until after he is finished before progressing to far with this project.

@m3nu
Copy link
Contributor

m3nu commented Jul 18, 2023

Our testing expert has entered the room. He honed his expertise on thousands of Borg tests. So this is easy for him. 😄

@diivi
Copy link
Contributor

diivi commented Jul 18, 2023

@bigtedde I might need your help with the tests for #1742 too 😉, and thanks for the great work!

@jetchirag
Copy link
Contributor

@jetchirag is currently working with the test suite on issues #1716 and #1711, so I will wait until after he is finished before progressing to far with this project.

I am mostly done with the task. Currently all tests are passing too but they are mostly identical to the unit tests so coverage won't really be effected much except some functions like local folder selector, extract etc. It would be great if you can have a look them though and we can cover the part which can't be included in the unit tests there.

@bigtedde
Copy link
Collaborator Author

bigtedde commented Jul 18, 2023

I might need your help with the tests for #1742 too 😉, and thanks for the great work!

@diivi I would be happy to help with testing your exclude GUI. I took a look at your PR - maybe there is a need for path/pattern testing?

@diivi
Copy link
Contributor

diivi commented Jul 18, 2023

maybe there is a need for path/pattern testing?

I'll probably just test all 3 tabs and if they alter the preview tab correctly.

And what gets passed to Borg.

After that everything should be handled by Borg, so I don't think testing if a particular pattern works or not should be necessary.

@bigtedde
Copy link
Collaborator Author

I am mostly done with the task. Currently all tests are passing too but they are mostly identical to the unit tests so coverage won't really be effected much except some functions like local folder selector, extract etc. It would be great if you can have a look them though and we can cover the part which can't be included in the unit tests there.

@jetchirag Great to hear that all tests are passing, and it sounds like your close to completing! I looked through your code from PR #1716 and if I am understanding it correctly you have been editing the tests to work on a live Borg binary instead of the hardcoded json outputs, and separating each file file into integration tests vs unit tests. I am really thankful for you putting in this work, as I think you are making the test suite much more approachable, orderly, and modular.

I would like to wait until your PR gets merged since it is essentially a new foundation for the test suite, and I would like to build upon it by filling in code coverage with additional unit tests and parameterizations of current ones. If you have any ideas of coverage that is most urgently needed from your time working with the test suite , I'd appreciate your insight :)

@bigtedde
Copy link
Collaborator Author

I'll probably just test all 3 tabs and if they alter the preview tab correctly.

And what gets passed to Borg.

I would be happy to help with this :)

@bigtedde
Copy link
Collaborator Author

bigtedde commented Aug 17, 2023

After the most recent test suite merges into master our total code coverage now sits at 78%.

@bigtedde bigtedde changed the title Improved Test Coverage FR: Improve Test Coverage: Test Plan Oct 22, 2023
@bigtedde bigtedde changed the title FR: Improve Test Coverage: Test Plan FR: Improve Test Coverage: A Test Plan Oct 22, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the status:stale This item will be closed soon due to inactivity label Apr 16, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2024
@m3nu
Copy link
Contributor

m3nu commented Apr 23, 2024

(Was already completed actually)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:stale This item will be closed soon due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants