Repository navigation
test(windows): restore MISE_TRUSTED_CONFIG_PATHS after the trust suite - #11948
Conversation
`AfterAll` removed the variable outright. Pester runs every suite in one process, so an inherited value was lost for whatever suite ran next. Save it in `BeforeAll` and restore it -- or remove it only when there was nothing to restore. `AfterEach` still clears it between this suite's own tests, which each set it explicitly. The same clear-only pattern in task.Tests.ps1 is fixed in jdx#11924.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Windows test suite now preserves the initial process-level ChangesTrusted configuration test isolation
Estimated code review effort: 1 (Trivial) | ~5 minutes Mergeability Score: ⚪ Minimal · up to This test-only change restores the process environment state after the Windows trust suite and does not introduce an actionable merge-blocking risk; it is merge-ready after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes Windows Pester test isolation by preserving the process's original
Confidence Score: 5/5The PR appears safe to merge because the changed suite now restores the process environment state it inherited. The save and cleanup operations use the same process environment scope, distinguish an unset variable from an empty or non-empty value, and run in the correct Pester lifecycle order. Important Files Changed
Reviews (1): Last reviewed commit: "test(windows): restore MISE_TRUSTED_CONF..." | Re-trigger Greptile |
e2e-win/trusted_config_paths.Tests.ps1'sAfterAllremovedMISE_TRUSTED_CONFIG_PATHSoutright. Pester runs every suite in one process, so if the process had inherited a value, it was
gone for whatever suite ran next.
Saved in
BeforeAll, restored inAfterAll— removed only when there was nothing to restore:AfterEachis unchanged: it clears the var between this suite's own tests, each of which sets itexplicitly. Only the cross-suite leak needed fixing.
This is the same pattern the new suites in #11937 use. The one other file with the same clear-only
AfterAllistask.Tests.ps1, fixed alongside its other changes in #11924 — the two were split soeach lands with the file it belongs to.
Test-only, one file. Windows Pester tests do not run in a Linux container, so
windows-e2eiswhat exercises it.
Summary by CodeRabbit
MISE_TRUSTED_CONFIG_PATHSenvironment setting, preventing test runs from affecting subsequent processes.