Skip to content

Commit dff3055

Browse files
lyarwoodmanusaclaude
authored
test(evals): add update-vm-instancetype eval task (#814)
* feat(evals): add update-vm-instancetype eval task Add a new kubevirt eval that tests doubling VM memory by changing instance types. Includes a verify_instancetype_changed helper function. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Lee Yarwood <lyarwood@redhat.com> * fix(evals): isolate update-vm-instancetype namespace and reuse helpers Bring the task in line with the suite-wide namespace-race fix from #1054: every kubevirt eval task uses a unique namespace so a previous task's asynchronous namespace teardown can't delete the next task's setup resources. This task still used the shared `vm-test` namespace and failed in CI with vm-test stuck Terminating and fedora-vm absent when the agent ran. - Use a dedicated vm-test-instancetype-update namespace in setup, the VM spec, verify, cleanup, and the prompt. - Replace the hand-rolled verify script with the shared verify-vm.sh helpers (verify_vm_exists, verify_instancetype, verify_no_direct_resources), matching update-vm-resources and create-vm-with-instancetype. - Add the task to the kubevirt task catalog README. Signed-off-by: Marc Nuri <marc@marcnuri.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: Lee Yarwood <lyarwood@redhat.com> Signed-off-by: Marc Nuri <marc@marcnuri.com> Co-authored-by: Marc Nuri <marc@marcnuri.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 35c5b3d commit dff3055

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

evals/tasks/kubevirt/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ KubeVirt-focused MCP tasks live here. Each folder under this directory represent
4949
- **[hard] update-vm-resources** - Update VM CPU and memory resources
5050
- **Prompt:** *A VirtualMachine named test-vm-update exists in the vm-test namespace. It currently has 1 vCPU and 2Gi of memory. Please update the VirtualMachine to add an additional vCPU (making it 2 vCPUs total) and increase the memory to at least 3Gi.*
5151

52+
- **[hard] update-vm-instancetype** - Double a VM's memory by switching its instancetype
53+
- **Prompt:** *A Fedora VirtualMachine named fedora-vm exists in the vm-test-instancetype-update namespace using the u1.small instancetype. Double its memory by updating the instance type.*
54+
5255
### VM Troubleshooting
5356

5457
- **[hard] troubleshoot-vm** - Use the vm-troubleshoot prompt to diagnose VirtualMachine issues
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
kind: Task
2+
apiVersion: mcpchecker/v1alpha2
3+
metadata:
4+
labels:
5+
suite: kubevirt
6+
requires: kubevirt
7+
name: "update-vm-instancetype"
8+
difficulty: hard
9+
spec:
10+
requires:
11+
- extension: kubernetes
12+
as: k8s
13+
setup:
14+
- k8s.delete:
15+
apiVersion: v1
16+
kind: Namespace
17+
metadata:
18+
name: vm-test-instancetype-update
19+
ignoreNotFound: true
20+
- k8s.create:
21+
apiVersion: v1
22+
kind: Namespace
23+
metadata:
24+
name: vm-test-instancetype-update
25+
- k8s.create:
26+
apiVersion: kubevirt.io/v1
27+
kind: VirtualMachine
28+
metadata:
29+
name: fedora-vm
30+
namespace: vm-test-instancetype-update
31+
spec:
32+
runStrategy: Halted
33+
instancetype:
34+
name: u1.small
35+
kind: VirtualMachineClusterInstancetype
36+
template:
37+
spec:
38+
domain:
39+
devices:
40+
disks:
41+
- name: containerdisk
42+
disk:
43+
bus: virtio
44+
volumes:
45+
- name: containerdisk
46+
containerDisk:
47+
image: quay.io/containerdisks/fedora:latest
48+
verify:
49+
- script:
50+
inline: |-
51+
#!/usr/bin/env bash
52+
source ../helpers/verify-vm.sh
53+
NS="vm-test-instancetype-update"
54+
55+
verify_vm_exists "fedora-vm" "$NS" || exit 1
56+
verify_instancetype "fedora-vm" "$NS" "u1.medium" || exit 1
57+
verify_no_direct_resources "fedora-vm" "$NS"
58+
59+
echo "All validations passed"
60+
exit 0
61+
cleanup:
62+
- k8s.delete:
63+
apiVersion: kubevirt.io/v1
64+
kind: VirtualMachine
65+
metadata:
66+
name: fedora-vm
67+
namespace: vm-test-instancetype-update
68+
ignoreNotFound: true
69+
- k8s.delete:
70+
apiVersion: v1
71+
kind: Namespace
72+
metadata:
73+
name: vm-test-instancetype-update
74+
ignoreNotFound: true
75+
prompt:
76+
inline: |
77+
A Fedora VirtualMachine named fedora-vm exists in the vm-test-instancetype-update namespace using the u1.small instancetype. Double its memory by updating the instance type.

0 commit comments

Comments
 (0)