Skip to content

Distro Module Preparation/Tests#6291

Open
harvey0100 wants to merge 2 commits intoavocado-framework:masterfrom
harvey0100:distro
Open

Distro Module Preparation/Tests#6291
harvey0100 wants to merge 2 commits intoavocado-framework:masterfrom
harvey0100:distro

Conversation

@harvey0100
Copy link
Copy Markdown
Contributor

Improvement of unit/functional tests, includes deprecation and new RST docstrings.

  • Enhance RST docstrings for all public classes and methods
  • Add deprecation warning for autils migration
  • Remove from .pylintrc_utils ignore list to enable pylint checking
  • Add to autils_migration_announcement workflow

@harvey0100 harvey0100 requested a review from richtja March 25, 2026 10:40
@harvey0100 harvey0100 self-assigned this Mar 25, 2026
@github-project-automation github-project-automation bot moved this to Review Requested in Avocado Kanban Mar 25, 2026
@mr-avocado mr-avocado bot moved this to Review Requested in Default project Mar 25, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 refines the avocado.utils.distro module by enhancing its documentation with reStructuredText (RST) docstrings, making the code more understandable and maintainable. It also introduces a deprecation warning for the module, aligning with a broader migration strategy. Furthermore, Pylint checks are now enabled for distro.py, and comprehensive new tests have been added to ensure the accuracy and reliability of the distribution detection mechanisms.

Highlights

  • Documentation Enhancement: RST docstrings were added or improved for all public classes and methods within the avocado/utils/distro.py module.
  • Deprecation Warning: A deprecation warning was introduced for the avocado.utils.distro module, signaling its eventual migration.
  • Pylint Integration: The distro.py module was removed from the .pylintrc_utils ignore list, enabling Pylint checks for this file.
  • Test Coverage Expansion: New unit and functional tests were added to improve the coverage and robustness of the distro detection logic.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/autils_migration_announcement.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request primarily focuses on enhancing the avocado.utils.distro module. It removes distro.py from the pylint ignore list, ensuring code quality checks are applied. The module's docstrings have been refactored for conciseness and consistency, with type hints added to method parameters and return values. A deprecation warning has also been introduced for the distro module. Accompanying these changes, extensive new unit tests have been added for the LinuxDistro class, various Probe methods, regex pattern matching for different distributions, SUSE-specific version parsing, probe registration, and the detect function. A new functional test, DistroDetectLocal, has also been added to verify local distro detection. Finally, the expected test counts in selftests/check.py have been updated to reflect these new additions.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.79%. Comparing base (322254c) to head (76f6c6a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6291      +/-   ##
==========================================
+ Coverage   73.67%   73.79%   +0.11%     
==========================================
  Files         206      206              
  Lines       22634    22636       +2     
==========================================
+ Hits        16676    16704      +28     
+ Misses       5958     5932      -26     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Add module docstring and enhance RST docstrings for all public
  classes and methods (pylint-compliant)
- Add deprecation warning for autils migration
- Remove from .pylintrc_utils ignore list to enable pylint checking
- Add to autils_migration_announcement workflow

Assisted-By: Cursor-Claude-4-Sonnet
Signed-off-by: Harvey Lynden <hlynden@redhat.com>
Add comprehensive test coverage for the distro module:

- 24 new unit tests covering LinuxDistro, Probe methods, regex patterns,
  SUSEProbe custom logic, register_probe, detect scoring/fallback, Spec
- 1 new functional test for local system detection
- Update TEST_SIZE counts in check.py (unit: 976->1000, functional: 368->369)

Coverage: 95% (untested: remote SSH session paths)

Assisted-By: Cursor-Claude-4-Sonnet
Signed-off-by: Harvey Lynden <hlynden@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review Requested
Status: Review Requested

Development

Successfully merging this pull request may close these issues.

1 participant