Skip to content

Conversation

@chunqingchen
Copy link
Contributor

@chunqingchen chunqingchen commented Apr 11, 2017

Relevant issue: #2653 #2649

Steps to reproduce

get-help about*
Expected behavior

get-help should be able to find the latest help files under $pshome

Actual behavior

get-help only get the files from C:\Windows\System32\WindowsPowerShell\v1.0

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.15016.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15016.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we use SilentlyContinue we do not need to use Test-Path.
We can move New-Item's in BeforeAll:

BeforeAll {
    $helpFile = "about_testCase.help.txt" 
    New-Item -ItemType Directory -Path "$PSHOME\en-US" -ErrorAction SilentlyContinue
    New-Item -ItemType File -Path "$PSHOME\en-US\$helpFile" -Value "about_test" -ErrorAction SilentlyContinue
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Closed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move it to AfterAll.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Closed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You missed "}".

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the extra line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Closed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we verify the exact value instead of $null?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Closed.

Copy link
Member

Choose a reason for hiding this comment

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

Should this be:

$helpContent | Should Not BeNullOrEmpty

Copy link
Collaborator

@iSazonov iSazonov Apr 12, 2017

Choose a reason for hiding this comment

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

Please clarify - is "Module" hardcoded for searching help files? And do this folder always exist? Maybe we should New-Item for it too?

@TravisEz13
Copy link
Member

I restarted MacOS because it appeared to have an issue downloading dotnet cli

@SteveL-MSFT
Copy link
Member

@chunqingchen please verify this also addresses #2649

Copy link
Member

Choose a reason for hiding this comment

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

Should be as follows to avoid output on console.

$null = New-Item -ItemType Directory -Path "$PSHOME\en-US" -ErrorAction SilentlyContinue 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

Copy link
Member

Choose a reason for hiding this comment

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

Should this be:

$helpContent | Should Not BeNullOrEmpty

@chunqingchen
Copy link
Contributor Author

@adityapatwardhan your comments are resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this test case only meant to run on en-US? If it is, then you should skip it for non-English runs. Otherwise, please use (get-uiculture).Name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

This check should probably be $helpContent | Should Match "about_test"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

@chunqingchen
Copy link
Contributor Author

@Francisco-Gamino thanks, your comments are resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, does this tests run on Linux? If it does, then please use Join-Path instead of "$path\value"
E.g.,
$helpContentPath = join-path $PSHOME $culture
if (-not (test-path $helpContentPath))
{
}

@chunqingchen
Copy link
Contributor Author

@Francisco-Gamino thanks, your comment is resolved !

@mirichmo
Copy link
Member

@Francisco-Gamino && @adityapatwardhan Do you guys have any more concerns or is this ready for merge?

@SteveL-MSFT SteveL-MSFT added this to the 6.0.0-beta1 milestone May 1, 2017
Copy link
Contributor

@Francisco-Gamino Francisco-Gamino left a comment

Choose a reason for hiding this comment

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

Please update this path $modulePath\en-US to $modulePath(get-uiculture).name. Other than that, it looks good. Thanks.

Describe "Validate about_help.txt under culture specific folder works" -Tags @('CI') {
BeforeAll {
$modulePath = "$pshome\Modules\Test"
$null = New-Item -Path $modulePath\en-US -ItemType Directory -Force
Copy link
Contributor

Choose a reason for hiding this comment

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

This path should be $modulePath(get-culture).name

@adityapatwardhan
Copy link
Member

@chunqingchen Changes approved.

@chunqingchen
Copy link
Contributor Author

@Francisco-Gamino en-us is replaced with culture
@mirichmo please merge the change.

@mirichmo mirichmo merged commit 5a82b10 into PowerShell:master May 1, 2017
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.

8 participants