CPU module: autils migration prep and tests#6279
CPU module: autils migration prep and tests#6279richtja merged 2 commits intoavocado-framework:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness and clarity of the Highlights
Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a great step towards migrating the avocado.utils.cpu module. The addition of comprehensive unit and functional tests significantly improves the module's reliability and maintainability. The documentation has also been greatly improved with more detailed and consistent docstrings. I've found a minor typo in a deprecation warning message and suggested a fix. Overall, this is a high-quality contribution.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6279 +/- ##
==========================================
+ Coverage 73.70% 74.10% +0.40%
==========================================
Files 206 206
Lines 22620 22634 +14
==========================================
+ Hits 16673 16774 +101
+ Misses 5947 5860 -87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
64e6ca2 to
c44014c
Compare
130b13c to
172a310
Compare
richtja
left a comment
There was a problem hiding this comment.
Hi @harvey0100, thank you for preparing the CPU migration. I have a couple of questions so please have a look.
Add comprehensive unit test coverage for the cpu module: - 29 new unit tests (28->57) covering get_revision, get_va_bits, get_model, get_x86_amd_zen, total_count, online_count, is_hotpluggable, online/offline, get_freq_governor, get_numa_node_has_cpus, lscpu, plus error paths and edge cases (FamilyException, NotImplementedError, IOError handling) - Update TEST_SIZE in check.py (unit: 976->1005) Coverage increased from 50% to 85%. Assisted-By: Cursor-Claude-4-Sonnet Signed-off-by: Harvey Lynden <hlynden@redhat.com> Made-with: Cursor
- Fix get_x86_amd_zen to handle model=0 and family=0 (use 'is None' check instead of truthiness, since 0 is valid for AMD Zen 1) - Add module docstring and enhance function RST docstrings (pylint-compliant) - Remove from .pylintrc_utils ignore list to enable pylint checking - Add to autils_migration_announcement workflow - Fix RST docstring markup for Sphinx (escape *args/**kwargs and path patterns) - Fix deprecation message typo (deprecat+ed -> deprecated) Assisted-By: Cursor-Claude-4-Sonnet Signed-off-by: Harvey Lynden <hlynden@redhat.com> Made-with: Cursor
richtja
left a comment
There was a problem hiding this comment.
Hi @harvey0100, thanks for the updates. it LTGM.
This PR prepares the avocado.utils.cpu module for migration to autils by improving tests and documentation. It adds 29 unit tests and 14 functional tests, raising coverage from about 50% to 85%. Tests cover get_revision, get_va_bits, get_model, get_x86_amd_zen, total_count, online_count, hotplug, frequency governor, NUMA, lscpu, and error paths. The module gets RST docstrings, is removed from the pylint ignore list, and is added to the autils migration announcement workflow.