From d74f8c952af848d65e3858094f8948a2bf4db567 Mon Sep 17 00:00:00 2001 From: Clint Branham Date: Mon, 23 Mar 2026 15:09:58 -0500 Subject: [PATCH] fix(test): add -Confirm:$false to Suspend/Restart container Pester tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../PSProxmoxVE.Tests/Containers/ContainerGapCmdlets.Tests.ps1 | 2 +- tests/PSProxmoxVE.Tests/Containers/ContainerLifecycle.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/PSProxmoxVE.Tests/Containers/ContainerGapCmdlets.Tests.ps1 b/tests/PSProxmoxVE.Tests/Containers/ContainerGapCmdlets.Tests.ps1 index 470c011..b0dd445 100644 --- a/tests/PSProxmoxVE.Tests/Containers/ContainerGapCmdlets.Tests.ps1 +++ b/tests/PSProxmoxVE.Tests/Containers/ContainerGapCmdlets.Tests.ps1 @@ -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*' } } diff --git a/tests/PSProxmoxVE.Tests/Containers/ContainerLifecycle.Tests.ps1 b/tests/PSProxmoxVE.Tests/Containers/ContainerLifecycle.Tests.ps1 index 582baba..80f9b25 100644 --- a/tests/PSProxmoxVE.Tests/Containers/ContainerLifecycle.Tests.ps1 +++ b/tests/PSProxmoxVE.Tests/Containers/ContainerLifecycle.Tests.ps1 @@ -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*' } }