mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-07-26 07:58:14 +00:00
fix(test): add -Confirm:$false to Suspend/Restart container Pester tests
Suspend-PveContainer and Restart-PveContainer gained ConfirmImpact.High in F062/F063 fixes. The "Should throw when no session is active" Pester tests invoke these cmdlets without -Confirm:$false, causing the confirmation prompt to fire before the session check — failing in non-interactive CI on all platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,7 +70,7 @@ Describe 'Suspend-PveContainer' -Tag 'Unit' {
|
||||
Context 'Without active session' {
|
||||
It 'Should throw when no session is active' {
|
||||
Skip-IfMissing 'Suspend-PveContainer'
|
||||
{ Suspend-PveContainer -Node 'pve' -VmId 100 -ErrorAction Stop } |
|
||||
{ Suspend-PveContainer -Node 'pve' -VmId 100 -Confirm:$false -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ Describe 'Restart-PveContainer' {
|
||||
Context 'Without active session' {
|
||||
It 'Should throw when no session is active' {
|
||||
Skip-IfMissing 'Restart-PveContainer'
|
||||
{ Restart-PveContainer -Node 'pve-node1' -VmId 200 -ErrorAction Stop } |
|
||||
{ Restart-PveContainer -Node 'pve-node1' -VmId 200 -Confirm:$false -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user