Skip to content

fix: virtctl_binary fixture downloads to pytest temp directory - #267

Merged
myakove merged 2 commits into
mainfrom
fix/issue-266-virtctl-temp-dir
Jan 21, 2026
Merged

myakove merged 2 commits into
mainfrom
fix/issue-266-virtctl-temp-dir

Conversation

@myakove

@myakove myakove commented Jan 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Updated virtctl_binary fixture to use pytest's tmp_path_factory for temporary file management
  • Made download_dir a required parameter in download_virtctl_binary() (removed /tmp fallback)
  • Removed trivial _get_virtctl_download_dir helper function
  • Used ensure_exists=True for ConsoleCLIDownload resource
  • Access links as attribute instead of .get()

Test plan

  • Verify virtctl binary downloads to pytest-managed temp directory
  • Confirm cleanup happens automatically via pytest temp management
  • Check that ConsoleCLIDownload resource is created with ensure_exists=True

Closes #266

Summary by CodeRabbit

  • Refactor
    • Optimized virtctl binary download and management process with enhanced temporary directory handling and improved error management for increased reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

@redhat-qe-bot1

Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 0 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove

Reviewers:

  • krcmarik
  • myakove
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@coderabbitai

coderabbitai Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

The changes refactor the virtctl_binary fixture and download_virtctl_from_cluster function to use pytest's temporary directory management instead of a default system location. The fixture now accepts tmp_path_factory and passes a pytest-managed temporary directory to the download function as a new parameter.

Changes

Cohort / File(s) Summary
Fixture parametrization
conftest.py
Added type annotations (DynamicClient, pytest.TempPathFactory, Path), introduced tmp_path_factory parameter, now creates temp directory via tmp_path_factory.mktemp("virtctl") and passes it to download_virtctl_from_cluster.
Download function refactoring
utilities/virtctl.py
Updated download_virtctl_from_cluster signature to accept download_dir: Path parameter; removed internal default directory creation; changed ConsoleCLIDownload initialization to use ensure_exists=True; simplified error handling; changed links access from .get("links") to .links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/issue-266-virtctl-temp-dir

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.

- Update virtctl_binary fixture to use tmp_path_factory for automatic cleanup
- Make download_dir a required parameter in download_virtctl_from_cluster
- Remove trivial _get_virtctl_download_dir helper function
- Use ensure_exists=True for ConsoleCLIDownload resource
- Access links as attribute instead of .get()
@myakove

myakove commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator Author

/verified

@myakove
myakove merged commit 0614b89 into main Jan 21, 2026
4 of 5 checks passed
@myakove
myakove deleted the fix/issue-266-virtctl-temp-dir branch January 21, 2026 07:05
@rh-bot-1

Copy link
Copy Markdown

Failed to build and push ghcr.io/redhatqe/mtv-api-tests:latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: virtctl_binary fixture should download to pytest temp directory

4 participants