Skip to content

feat: Add vm templates STD#5460

Open
RoniKishner wants to merge 1 commit into
RedHatQE:mainfrom
RoniKishner:vm-template-test
Open

feat: Add vm templates STD#5460
RoniKishner wants to merge 1 commit into
RedHatQE:mainfrom
RoniKishner:vm-template-test

Conversation

@RoniKishner

@RoniKishner RoniKishner commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
What this PR does / why we need it:

Add STD for testing Kubevirt virtual machine templates.

Which issue(s) this PR fixes:
  • Admission behavior: verifies that templates whose defaulted parameters always produce a valid VM definition are accepted, while templates that would always produce an invalid VM are rejected by the admission webhook.
  • Capability feature gate: verifies that disabling the Template capability blocks new template and template-request creation while preserving existing objects, and that re-enabling it restores full template workflows.
Special notes for reviewer:
jira-ticket:

https://redhat.atlassian.net/browse/CNV-86112

Summary by CodeRabbit

  • Tests
    • Added coverage for virtual machine template admission behavior, including valid defaulted templates and invalid templates being rejected.
    • Added coverage for template capability gating, ensuring template creation is blocked when disabled and allowed when re-enabled.
    • Expanded checks for creating virtual machines from existing template-based requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: rkishner <rkishner@redhat.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 40bc1413-fa4e-4604-8eaa-8177e8ee0efa

📥 Commits

Reviewing files that changed from the base of the PR and between e287002 and cf33928.

📒 Files selected for processing (2)
  • tests/infrastructure/vm_template/test_vm_template_admission.py
  • tests/infrastructure/vm_template/test_vm_template_capability.py

📝 Walkthrough

Walkthrough

Two new pytest test modules are added under tests/infrastructure/vm_template/. Both define test classes with __test__ = False and contain only docstrings describing intended VirtualMachineTemplate admission and capability-gate behaviors, without executable test logic.

Changes

VM Template test stubs

Layer / File(s) Summary
Admission behavior test stubs
tests/infrastructure/vm_template/test_vm_template_admission.py
Adds TestVMTemplateAdmission class with two Polarion-marked, docstring-only test functions describing expected accept/reject outcomes for defaulted VM template parameters.
Capability gate test stubs
tests/infrastructure/vm_template/test_vm_template_capability.py
Adds TestVMTemplateCapability incremental test class with six Polarion-marked, docstring-only test functions describing expected blocking/preservation/reenabling behavior of VirtualMachineTemplate and VirtualMachineTemplateRequest creation when the Template capability is disabled/reenabled.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: new-tests

Sequence Diagram(s)

Not applicable — both modules contain only docstring placeholders without executable logic or observable component interactions.

Poem

A rabbit hopped through fields of test,
Found stub files, docstrings dressed,
No asserts, no calls to trace,
Just Polarion tags in place,
"Someday soon," it twitched with glee,
"These stubs will run for you and me!" 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is under 120 characters and clearly indicates a change adding VM templates STD coverage.
Description check ✅ Passed The PR description matches the template sections and includes a Jira ticket, with only minor gaps in reviewer notes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stp Link Required ✅ Passed Both added test modules include module-level STP URLs, so the new test classes/functions are traceable as required.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped RedHatQE/openshift-virtualization-tests-design-docs.


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.

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

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: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • 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: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 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
  • /security-override - Set security check runs to pass (maintainers only)
  • /security-override cancel - Re-run security checks

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (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 verify-bugs-are-open - verify-bugs-are-open
  • /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
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

Custom Commands

  • /test-plan - Triggers CodeRabbit to analyze the PR's changed files and post a test execution plan
  • /rerun-smoke - Adds `retest-smoke` label on the PR to trigger smoke tests exectuion

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 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • RoniKishner
  • dshchedr
  • geetikakay
  • mijankow
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6-1m)
Security Checks
  • Suspicious Path Detection: Monitors paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/
  • Committer Identity Check: Verifies last committer matches PR author
  • Mandatory: Security checks block merge (use /security-override to bypass — maintainers only)

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • 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.

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.

4 participants