refactor: make all integration test files self-contained

Each test file now creates and cleans up its own resources:
- 06_VMs: restores own AfterAll cleanup for pester-test-vm
- 07_Snapshots: creates pester-snap-vm, tests snapshots, cleans up
- 09_CloudInit: creates pester-ci-vm with cloud-init drive, cleans up
- 15_Tasks: creates pester-task-vm, tests task CRUD, cleans up

Removed cross-file dependency helpers (Find-TestVm, Register-TestResource)
from _IntegrationHelper.ps1 — no longer needed.

Each file can now run independently via -Tests filter. If a Setup
context fails, subsequent tests in the same file skip gracefully.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-25 13:40:05 -05:00
parent 72280e3697
commit 117b10d222
6 changed files with 157 additions and 92 deletions
@@ -62,7 +62,6 @@ Describe 'Linux VM — Integration' -Tag 'Integration' {
$script:LinuxVmId = $vm.VmId
$script:CreatedVmIds.Add($vm.VmId)
Register-TestResource -Name 'pester-linux-vm' -VmId $vm.VmId
}
It 'Should import cloud image disk (Import-PveVmDisk)' {