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

Avocado Jobs Keys #6076

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Avocado Jobs Keys #6076

merged 1 commit into from
Dec 18, 2024

Conversation

harvey0100
Copy link
Contributor

@harvey0100 harvey0100 commented Dec 2, 2024

Fix: Handle missing job data in 'avocado jobs list' command

  • Updated 'handle_list_command' to use job.get() for safely accessing job data.
  • If a key is missing, it now defaults to '' instead of causing a crash.
  • Refactored some code due to codeclimate suggestion.

Reference: #6067

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 36.00000% with 16 lines in your changes missing coverage. Please review.

Project coverage is 68.63%. Comparing base (b80f298) to head (3b95771).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
avocado/plugins/jobs.py 36.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6076       +/-   ##
===========================================
+ Coverage   54.32%   68.63%   +14.30%     
===========================================
  Files         202      202               
  Lines       21892    21910       +18     
===========================================
+ Hits        11892    15037     +3145     
+ Misses      10000     6873     -3127     

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

Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @harvey0100, thank you for investigating this and finding a solution. I have a few small comments, please take a look. Also, I would like to ask you to add tests which will catch the issues from #6067 in the future. Thank you.

avocado/plugins/jobs.py Outdated Show resolved Hide resolved
avocado/plugins/jobs.py Outdated Show resolved Hide resolved
avocado/plugins/jobs.py Outdated Show resolved Hide resolved
Fix: Handle missing job data in 'avocado jobs list' command
- Updated 'handle_list_command' to use `job.get()` for safely accessing job data.
- If a key is missing, it now defaults to '<unknown>' instead of causing a crash.
- Refactored some code due to codeclimate suggestion.

Reference:      avocado-framework#6067
Signed-off-by: Harvey Lynden <hlynden@redhat.com>
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 6823e6b into avocado-framework:master Dec 18, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done 109
Development

Successfully merging this pull request may close these issues.

3 participants