Repository navigation
Adding '$pshome/cultureName/default.help.txt' to PowerShell Windows Core project. - #3032
Mike Richmond (mirichmo) merged 4 commits into
Conversation
There was a problem hiding this comment.
$helpContent | Should Match Update-Help [](start = 8, length = 39)
Do you also want to check that the file is present at the expected location under $PSHome?
|
🕐 |
There was a problem hiding this comment.
I'd like to see something more explicit - is the goal here to see that help is rendered to a string, or is it the right string? I believe this assertion would be true even for Get-Help Get-Command. How about:
$HelpInfo = Get-Help Get-Help
$HelpInfo.Name | should be "Get-Help"
Is the requirement that Update-Help be found anywhere specific?
There was a problem hiding this comment.
my assumption is that this test is not validating the actual formatting of the help, but that we're returning the right thing
In reply to: 97399837 [](ancestors = 97399837)
… powershell-win-core
… is present. This is done by calling 'Get-Help'
|
|
…alTestHooks.BypassOnlineHelpRetrieval is enable. This way, we force get-help to generate a metadata driven help object, which includes a helpUri that points to the fwlink defined in the cmdlet code.
…iles. Instead, I've added logic to get-help to not find the help file when the test hook BypassOnlineHelpRetrieval is enable.
Codecov Report
Continue to review full report at Codecov.
|
|
Mike Richmond (@mirichmo) Dongbo Wang (@daxian-dbw) : Could you please merge this PR when you have time? Thanks in advance. |
| if (InternalTestHooks.BypassOnlineHelpRetrieval) | ||
| { | ||
| // By returning null, we force get-help to generate a metadata driven help object, | ||
| // which includes a helpUri that points to the fwlink defined in the cmdlet code. |
There was a problem hiding this comment.
Do we have any tests that actually depend on this test hook to test the metadata driven help?
There was a problem hiding this comment.
I'm asking this because I don't see this test hook is used for this purpose in the tests from this PR.
There was a problem hiding this comment.
Dongbo Wang (@daxian-dbw) : Yes we do. These are located test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1, which are part of this PR. Please see "Files Changed" section.
There was a problem hiding this comment.
- get-help will not find a help file; instead, it will generate a metadata driven object.
- get-help -online will return the helpuri instead of opening the default web browser.
Yes, I know this test hook is used in that test, but it's used there for get-help -online to return helpuri instead of opening web browser. I don't see where it's used for getting metadata driven help object. Maybe I missed something, can you please clarify?
…ore project. (PowerShell#3032) * Adding PowerShellHelpFiles package which contains default.help.txt to powershell-win-core * Adding test case to validate that <pshome>/<culture>/default.help.txt is present. This is done by calling 'Get-Help' * Updating get-help to skip searching for the help file when the InternalTestHooks.BypassOnlineHelpRetrieval is enable. This way, we force get-help to generate a metadata driven help object, which includes a helpUri that points to the fwlink defined in the cmdlet code. * Updating get-help -online <cmdletName> tests to not delete the help files. Instead, I've added logic to get-help to not find the help file when the test hook BypassOnlineHelpRetrieval is enable.
Fixing issue '$pshome/cultureName/default.help.txt' is missing #1731
Added package PowerShellHelpFiles to the PowerShell Windows Core project (src/powershell-win-core/project.json) to include the help files when PowerShell is published.
Added a test to validate that '$pshome/cultureName/default.help.txt' is present. This is done by calling 'get-help' which returns information about the help system.
Updated the get-help cmdlet to force return a metadata driven object when the test hook BypassOnlineHelpRetrieval is enable.
Updated get-help -online tests to not delete the help files before running, and updated the comments in the test code.