Fix HelpSystem tests for invariant culture by KirtiRamchandani · Pull Request #27547 · PowerShell/PowerShell
PR Summary
Make the help function uses full view by default CI tests switch to en-US when the process culture or UI culture is invariant, then restore the original cultures after the describe block.
PR Context
Fixes #27532.
These tests assert against the PARAMETERS section from the bundled full help content. On Linux environments where the culture resolves to invariant culture (LCID 127), the localized help content is not selected, so those assertions can fail even though the full-view behavior is not broken. This mirrors the invariant-culture guard already used by the UpdatableHelp tests.
Validation
git diff --check -- test/powershell/engine/Help/HelpSystem.Tests.ps1- Parsed
test/powershell/engine/Help/HelpSystem.Tests.ps1withSystem.Management.Automation.Language.Parser - Verified the culture guard switches invariant culture to
en-USand restores the saved cultures Start-PSBuild -Clean -PSModuleRestore -UseNuGetOrgStart-PSPester -Path test/powershell/engine/Help/HelpSystem.Tests.ps1 -Tag CI -UseNuGetOrg(local run reached the targeted file but the desktop host hit existing non-interactive Help test failures: invalid console handle inhelpcalls plus unrelated help-file lookup misses)
PR Checklist
- I have read the CONTRIBUTING document.
- If this PR is work in progress, I am opening the PR as a draft.
- The PR is made against the
masterbranch. - My commit messages follow the repository guidelines.
- I have added tests or validation that prove my fix is effective or that my feature works.
- I have added necessary documentation, if appropriate.