Skip to content

Adding '$pshome/cultureName/default.help.txt' to PowerShell Windows Core project. - #3032

Merged
Mike Richmond (mirichmo) merged 4 commits into
PowerShell:masterfrom
Francisco-Gamino:default-help-fix-1
Feb 2, 2017
Merged

Mike Richmond (mirichmo) merged 4 commits into
PowerShell:masterfrom
Francisco-Gamino:default-help-fix-1

Conversation

@Francisco-Gamino

@Francisco-Gamino Francisco Gamino (Francisco-Gamino) commented Jan 23, 2017 •

Copy link
Copy Markdown
Contributor

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.

@Francisco-Gamino Francisco Gamino (Francisco-Gamino) changed the title Default help fix 1 Adding '$pshome/cultureName/default.help.txt' to PowerShell Windows Core project. Jan 23, 2017
@PowerShellTeam PowerShellTeam added the Review - Needed The PR is being reviewed label Jan 23, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$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?

@adityapatwardhan

Copy link
Copy Markdown
Member

🕐

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@JamesWTruher

James Truher (JamesWTruher) commented Jan 30, 2017 •

Copy link
Copy Markdown
Collaborator

:shipit:

…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-io

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@1431105).


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1431105...f57bb0f. Read the comment docs.

@Francisco-Gamino

Copy link
Copy Markdown
Contributor Author

Mike Richmond (@mirichmo) Dongbo Wang (@daxian-dbw) : Could you please merge this PR when you have time? Thanks in advance.

@mirichmo
Mike Richmond (mirichmo) merged commit f57f924 into PowerShell:master Feb 2, 2017
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any tests that actually depend on this test hook to test the metadata driven help?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking this because I don't see this test hook is used for this purpose in the tests from this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@daxian-dbw Dongbo Wang (daxian-dbw) Feb 2, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. get-help will not find a help file; instead, it will generate a metadata driven object.
  2. 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?

@iSazonov Ilya (iSazonov) removed the Review - Needed The PR is being reviewed label Mar 27, 2017
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants