HelpSystem.Tests.ps1 cannot handle culture not being defined
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 78/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 冷清
- 技術堆疊
- powershell
- 領域
- testing-qa
研究方向
先查看 test/powershell/engine/Help/HelpSystem.Tests.ps1 中第 425 行和第 434 行附近的內容,然後比較 test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 中第 438-441 行附近的 culture 處理。將目前的 culture 設定為 Invariant Language (LCID 127) 後,執行受影響的 Help 測試。如果兩個 full-help 測試都在該環境中無錯誤通過,就表示完成。
由索引模型根據 Issue 內容生成。
描述
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Reproducible on 7.6.2.
The test "help should return full view without -Full switch" and "help should return full view even with -Full switch" have the problem, that they'll break if the current culture is Invariant Language (Invariant Country) (LCID 127). This can happen on Linux systems if the LANG etc. environment variables are left to C.UTF-8. In this situation, there's no Get-Help pages available in the current language - and thus no PARAMETERS section either on a "Full" help page, breaking the test.
In the past, UpdatableHelpSystem.Tests.ps1 has been fixed by 16558c94146e44422f9e5b4f0f917775def51087 and now sets a culture if LCID is 127. This test would need a similar fix.
Expected behavior
No error.
Actual behavior
[-] help should return full view without -Full switch 6ms
Expected a value, but got $null or empty.
425: $gpsHelp | Where-Object {$_ -cmatch '^PARAMETERS'} | Should -Not -BeNullOrEmpty
at <ScriptBlock>, /build/powershell/src/PowerShell/test/powershell/engine/Help/HelpSystem.Tests.ps1: line 425
[-] help should return full view even with -Full switch 6ms
Expected a value, but got $null or empty.
434: $gpsHelp | Where-Object {$_ -cmatch '^PARAMETERS'} | Should -Not -BeNullOrEmpty
at <ScriptBlock>, /build/powershell/src/PowerShell/test/powershell/engine/Help/HelpSystem.Tests.ps1: line 434
Error details
Environment data
Name Value
---- -----
PSVersion 7.6.2
PSEdition Core
GitCommitId 7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19
OS Arch Linux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
- 主要語言
- C#
- 星號
- 55.5k
- 分支
- 8.5k
- 平均合併
- 1 天 17 小時
- 30 天內合併 PR
- 97
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
PowerShell/PowerShell 的其他 Issue
-
Issue-Enhancement Needs-Triage
難度 1/5 1 小時以內 新手友好度 86/100
PowerShell/PowerShell#28061 · 2 個 reaction ·
-
難度 1/5 1 小時以內 新手友好度 90/100
PowerShell/PowerShell#28037 ·
-
Needs-Triage
難度 2/5 1-3 小時 新手友好度 74/100
PowerShell/PowerShell#27973 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
PowerShell/PowerShell#27720 ·
-
Issue-Bug Up-for-Grabs WG-Cmdlets WG-Reviewed
難度 2/5 1-3 小時 新手友好度 72/100
PowerShell/PowerShell#27670 · 3 則留言 ·
查看 PowerShell/PowerShell 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
nightscout/nocturne#1425 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 65/100
-
Documentation
難度 2/5 1-3 小時 新手友好度 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
難度 2/5 1-2 天 新手友好度 75/100
Altinn/altinn-auth#4143 ·