Repository navigation
🧪 test: add Set-SvcState error handling tests in Undo mode - #55
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Add comprehensive Pester unit tests for Set-SvcState error handling in Undo mode: - Test error trapping when Set-Service throws an exception during restore. - Test error trapping when Start-Service throws an exception for non-Manual startup types. - Test best-effort error handling when Start-Service throws for Manual startup types. - Fix existing debloat mode Set-SvcState error trapping test so Set-Service is mocked to throw. - Add cross-platform Set-ItemProperty stubs in BeforeAll for non-Windows testing.
f737517 to
cabbbb5
Compare
🎯 What: Missing error handling tests for
Set-SvcStatein Undo mode (unslop-win11.ps1andunslop-win10.ps1).📊 Coverage:
Set-Servicethrows an exception in Undo mode, validating that$global:FailCountincrements andFAILED: Could not restore service...is logged.Start-Servicethrows an exception in Undo mode for non-Manual startup types (e.g., Automatic), validating that$global:FailCountincrements andFAILED: Could not restore service...is logged.Start-Servicefails for Manual startup type (validating$global:FailCountremains 0).Set-SvcStateerror trapping test soSet-Servicethrows (sinceStop-Servicefailure is caught by an inner best-effort block).Set-ItemPropertystubs inBeforeAllfor non-Windows testing sessions.✨ Result: Improved unit test coverage and failure honesty verification for service restoration error paths across
unslop-win11.Tests.ps1andunslop-win10.Tests.ps1.PR created automatically by Jules for task 17759227103164624893 started by @Ahmed-Yaseen99