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

VMimage get --debug option #6061

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Conversation

richtja
Copy link
Contributor

@richtja richtja commented Oct 31, 2024

This commit adds a new option to vmimage get feature called debug. It brings possibility to run vmimage command in debug mode to get more detailed information about possible failures. In debug mode, all exceptions caused by vmimage utility will be raised to console. That should provide enough information for further debugging of possible issues.

Reference: #6051


vmimage get without debug:

$ avocado vmimage get --distro Fedora --distro-version 2 
The requested image could not be downloaded

vmimage get with debug:

$ avocado vmimage get --distro Fedora --distro-version 2 --debug
avocado.utils.vmimage: Version not available at https://dl.fedoraproject.org/pub/fedora/linux/releases/
The requested image could not be downloaded

@richtja richtja added this to the 109 - Codename TBD milestone Oct 31, 2024
@richtja richtja self-assigned this Oct 31, 2024
@richtja richtja linked an issue Oct 31, 2024 that may be closed by this pull request
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 54.44%. Comparing base (6b55d5a) to head (7420e5f).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
avocado/plugins/vmimage.py 14.28% 6 Missing ⚠️
avocado/utils/vmimage.py 37.50% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6061      +/-   ##
==========================================
- Coverage   54.46%   54.44%   -0.03%     
==========================================
  Files         202      202              
  Lines       21883    21890       +7     
==========================================
- Hits        11919    11918       -1     
- Misses       9964     9972       +8     

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


🚨 Try these New Features:

Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

Hi @richtja ,

Thanks for working on this. While this gets the most important thing done, that is, info about a failure, IMO a --debug option should:

  1. Also work during success cases, that is, it should show what's going on whether the operation is succeeding or failing
  2. Should not crash the application

Have you tried adding various logging entries to the avocado.utils.vmimage module and making them visible when --debug is given?

@richtja richtja force-pushed the vmimage_debug branch 2 times, most recently from c5d30e1 to 9635303 Compare November 6, 2024 13:44
@richtja
Copy link
Contributor Author

richtja commented Nov 6, 2024

Hi @richtja ,

Thanks for working on this. While this gets the most important thing done, that is, info about a failure, IMO a --debug option should:

1. Also work during success cases, that is, it should show what's going on whether the operation is succeeding or failing

2. Should not crash the application

Have you tried adding various logging entries to the avocado.utils.vmimage module and making them visible when --debug is given?

Hi @clebergnu, thanks for your review. I have changed this PR to use logging instead of raising errors. Please have a look.

This commit adds logs to the vmimage utility. After this change, vmimage
will log information about ImageProviderErrors.

Reference: avocado-framework#6051
Signed-off-by: Jan Richter <[email protected]>
This commit adds a new option to `vmimage get` feature called `debug`.
It brings possibility to run vmimage command in debug mode to get more
detailed information about possible failures. In debug mode, all
exceptions caused by vmimage utility will be logged to console. That
should provide enough information for further debugging of possible
issues.

Reference: avocado-framework#6051
Signed-off-by: Jan Richter <[email protected]>
Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@clebergnu clebergnu merged commit 26441ef into avocado-framework:master Nov 22, 2024
58 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done 109
Development

Successfully merging this pull request may close these issues.

Error log for 'avocado image'
2 participants