Skip to content

Improve readability and test coverage of cli #42

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

Merged
merged 12 commits into from
Apr 24, 2025

Conversation

gmmajal
Copy link
Contributor

@gmmajal gmmajal commented Apr 10, 2025

Relevant issue: #40

Background info: # any relevant background info for additional context, references to documentations etc.

  • Our codecov plugin is highlighting that the most amount of lines missed by our unit tests reside in the qualle/interface/cli.py script. We can improve our code coverage by adding more unit tests for the cli interface.
  • The cli_entrypoint() method is too long. It should be split into smaller chunks in order to make it easier to test and to improve readability.

Changes introduced: # list changes to the code repo made in this pull request

  • Additional unit tests have been inserted in tests/interface/test_cli.py. These tests check the behavior of the method cli_entrypoint() and other methods in qualle/interface/cli.py which were previously missed in our coverage.
  • cli_entrypoint() has been refactored to make it easier to read. Four different methods have been added to create subparsers which are being utilized by our cli.
  • main.py has been refactored slightly in order to write appropriate unit tests. The coverage is skipped for the line under the if block. Some new unit tests have been under the script test_main.py

@gmmajal gmmajal self-assigned this Apr 10, 2025
@gmmajal gmmajal linked an issue Apr 10, 2025 that may be closed by this pull request
2 tasks
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (420d37e) to head (d7f917e).

Additional details and impacted files
@@             Coverage Diff             @@
##           master       #42      +/-   ##
===========================================
+ Coverage   94.87%   100.00%   +5.12%     
===========================================
  Files          23        22       -1     
  Lines         898       905       +7     
===========================================
+ Hits          852       905      +53     
+ Misses         46         0      -46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmmajal gmmajal marked this pull request as ready for review April 11, 2025 13:57
@gmmajal gmmajal requested a review from Lakshmi-bashyam April 11, 2025 13:59
@gmmajal
Copy link
Contributor Author

gmmajal commented Apr 22, 2025

Further changes:

@gmmajal gmmajal merged commit 766abec into master Apr 24, 2025
9 checks passed
@gmmajal gmmajal mentioned this pull request Apr 24, 2025
2 tasks
@gmmajal gmmajal deleted the 40-improve-coverage-and-readability-of-cli branch April 29, 2025 13:10
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.

Improve coverage and readability
3 participants