Updating tests to install the help content before running on Windows
This commit is contained in:
parent
2b1dc87774
commit
135af2089a
|
@ -17,7 +17,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
"ubuntu.16.04-x64": { },
|
"ubuntu.16.04-x64": { },
|
||||||
"ubuntu.14.04-x64": { },
|
"ubuntu.14.04-x64": { },
|
||||||
"debian.8-x64": { },
|
"debian.8-x64": { },
|
||||||
"centos.7-x64": { },
|
"centos.7-x64": { },
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<HelpInfo xmlns="http://schemas.microsoft.com/powershell/help/2010/05">
|
||||||
|
<HelpContentURI>http://go.microsoft.com/fwlink/?linkid=390782</HelpContentURI>
|
||||||
|
<SupportedUICultures>
|
||||||
|
<UICulture>
|
||||||
|
<UICultureName>en-US</UICultureName>
|
||||||
|
<UICultureVersion>5.0.7.0</UICultureVersion>
|
||||||
|
</UICulture>
|
||||||
|
</SupportedUICultures>
|
||||||
|
</HelpInfo>
|
Binary file not shown.
|
@ -5,7 +5,29 @@ function RunTestCase
|
||||||
{
|
{
|
||||||
param ([string]$tag = "CI")
|
param ([string]$tag = "CI")
|
||||||
|
|
||||||
$cmdlets = get-command -module "Microsoft.PowerShell.Core"
|
$moduleName = "Microsoft.PowerShell.Core"
|
||||||
|
|
||||||
|
if ($IsWindows)
|
||||||
|
{
|
||||||
|
if ($tag -eq "CI")
|
||||||
|
{
|
||||||
|
$helpContentPath = join-path $PSScriptRoot "HelpContent"
|
||||||
|
$helpFiles = @(Get-ChildItem "$helpContentPath\*" -ea SilentlyContinue)
|
||||||
|
|
||||||
|
if ($helpFiles.Count -eq 0)
|
||||||
|
{
|
||||||
|
throw "unable to find help content at '$helpContentPath'"
|
||||||
|
}
|
||||||
|
Update-Help -Module $moduleName -SourcePath $helpContentPath -Force -ErrorAction Stop -Verbose
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Update-Help -Module $moduleName -Force -Verbose -ErrorAction Stop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$cmdlets = get-command -module $moduleName
|
||||||
|
|
||||||
$cmdletsToSkip = @(
|
$cmdletsToSkip = @(
|
||||||
"Get-PSHostProcessInfo",
|
"Get-PSHostProcessInfo",
|
||||||
|
@ -13,8 +35,6 @@ function RunTestCase
|
||||||
"Register-ArgumentCompleter"
|
"Register-ArgumentCompleter"
|
||||||
)
|
)
|
||||||
|
|
||||||
$testCaseExecuted = $false
|
|
||||||
|
|
||||||
foreach ($cmdletName in $cmdlets)
|
foreach ($cmdletName in $cmdlets)
|
||||||
{
|
{
|
||||||
if ($cmdletsToSkip -notcontains $cmdletName)
|
if ($cmdletsToSkip -notcontains $cmdletName)
|
||||||
|
@ -24,10 +44,9 @@ function RunTestCase
|
||||||
$help = get-help -name $cmdletName
|
$help = get-help -name $cmdletName
|
||||||
$help.Description | Out-String | Should Match $cmdletName
|
$help.Description | Out-String | Should Match $cmdletName
|
||||||
$help.Examples | Out-String | Should Match $cmdletName
|
$help.Examples | Out-String | Should Match $cmdletName
|
||||||
$testCaseExecuted = $true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($tag -eq "CI") -and $testCaseExecuted)
|
if ($tag -eq "CI")
|
||||||
{
|
{
|
||||||
# For a CI test run, we are only interested in validating one cmdlet to ensure that
|
# For a CI test run, we are only interested in validating one cmdlet to ensure that
|
||||||
# get-help <cmdletName> works.
|
# get-help <cmdletName> works.
|
||||||
|
|
Loading…
Reference in a new issue