Cover the custom-feature apply and undo bodies - #84
Merged
Merged
Conversation
The Enable/Disable functions for gaming mode, performance tweaks, security hardening and the extended AI purge do real registry, service, power, firewall and optional-feature changes, but nothing ran a body outside the Windows Sandbox mutating suite. The static guard in Test-ModuleRollback only parses the declared target lists. New unit tests run each body with every OS-touching command mocked, and powercfg and netsh shadowed by no-op functions so a missed mock cannot reach the real machine. They assert the values written, that missing keys are created, that -WhatIf gates every change, and that each undo reverses the right values. The runtime drift check is stronger than the static one: it confirms every path and name a body actually writes is declared by that module's registry-target provider, so a wrong key path is caught, not just a wrong value name. Wired the new file into the CI workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Enable/Disable functions for gaming mode, performance tweaks, security hardening and the extended AI purge do real registry, service, power, firewall and optional-feature changes. Until now nothing ran a body outside the Sandbox mutating suite; the static guard in
Test-ModuleRollbackonly parses the declared target lists.Test-CustomFeatureApply.ps1runs each apply and undo body with every OS-touching command mocked, andpowercfg/netshshadowed by no-op functions so a missed mock cannot reach the real machine. It asserts:-WhatIfgates every registry/service/firewall change (nothing runs)Test-only. New file wired into the CI workflow. Validation run locally: static validation clean (139 files), full unit suite 279 passed / 0 failed (was 252). Not run locally: the Sandbox mutating suite (unchanged) and CI's pwsh/MTA pass, which runs on the PR.