Skip to content

Enhance avocado_guest test to run host tests in guest#4440

Open
narasimhan-v wants to merge 1 commit intoautotest:masterfrom
narasimhan-v:host_test_fix
Open

Enhance avocado_guest test to run host tests in guest#4440
narasimhan-v wants to merge 1 commit intoautotest:masterfrom
narasimhan-v:host_test_fix

Conversation

@narasimhan-v
Copy link
Copy Markdown

@narasimhan-v narasimhan-v commented Feb 9, 2026

avocado_guest test runs any avocado-misc host test in the guest. This patch adds test repo branch parameter, and adds logic to parse test results and fails accordingly.

Depends on avocado-framework/avocado-vt#4319

Summary by CodeRabbit

  • New Features

    • Added an option to select which Avocado test branch to use (defaults to 'master').
  • Bug Fixes

    • Improved test failure detection and clearer diagnostic messages when tests fail.
  • Chores

    • Changed the default test installation method from pip to git.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 9, 2026

Walkthrough

The change updates generic/tests/avocado_guest.py: default avocadoinstalltype is changed from "pip" to "git"; a new parameter avocadotestbranch (default "master") is added and passed to AvocadoGuest as testbranch; ignore_result in the AvocadoGuest call is set to True; the code now captures run_avocado()'s return value and calls test.fail() with a diagnostic message if the result is falsy. The AvocadoGuest constructor call signature is extended to include testbranch.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main enhancement: enabling the avocado_guest test to execute host tests within a guest environment, which aligns with the primary changes in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@generic/tests/avocado_guest.py`:
- Around line 45-47: The check for result after calling
avocado_obj.run_avocado() is dead because run_avocado() raises on failure when
called with ignore_result=False; either remove the unreachable lines that call
test.fail(...) (delete the if not result block) or change the call to
run_avocado(ignore_result=True) so it returns a boolean and keep the subsequent
if not result: test.fail(...) handling; locate the call to
avocado_obj.run_avocado() and the test.fail() usage to apply one of these two
changes consistently.

Comment thread generic/tests/avocado_guest.py
avocado_guest test runs any avocado-misc host test in the guest.
This patch adds test repo branch parameter, and adds logic to parse
test results and fails accordingly.

Signed-off-by: Narasimhan V <16101053+narasimhan-v@users.noreply.github.com>
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.

1 participant