Breaking down help tests for CI and Feature test runs
This commit is contained in:
parent
3ed7201e21
commit
233e75657a
2 changed files with 41 additions and 16 deletions
|
@ -17,6 +17,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
|
"ubuntu.16.04-x64": { },
|
||||||
"ubuntu.14.04-x64": { },
|
"ubuntu.14.04-x64": { },
|
||||||
"debian.8-x64": { },
|
"debian.8-x64": { },
|
||||||
"centos.7-x64": { },
|
"centos.7-x64": { },
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
Describe 'Basic help system tests' -Tags "CI" {
|
#
|
||||||
|
# Validates Get-Help for cmdlets in Microsoft.PowerShell.Core.
|
||||||
|
|
||||||
Context "Validate help content for cmdlets in Microsof.PowerShell.Core" {
|
function RunTestCase
|
||||||
|
{
|
||||||
|
param ([string]$tag = "CI")
|
||||||
|
|
||||||
$cmdlets = get-command -module "Microsoft.PowerShell.Core"
|
$cmdlets = get-command -module "Microsoft.PowerShell.Core"
|
||||||
|
|
||||||
$cmdletsToSkip = @(
|
$cmdletsToSkip = @(
|
||||||
"Get-PSHostProcessInfo",
|
"Get-PSHostProcessInfo",
|
||||||
"Out-Default",
|
"Out-Default",
|
||||||
"Register-ArgumentCompleter"
|
"Register-ArgumentCompleter"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$testCaseExecuted = $false
|
||||||
|
|
||||||
foreach ($cmdletName in $cmdlets)
|
foreach ($cmdletName in $cmdlets)
|
||||||
{
|
{
|
||||||
if ($cmdletsToSkip -notcontains $cmdletName)
|
if ($cmdletsToSkip -notcontains $cmdletName)
|
||||||
|
@ -18,8 +24,26 @@
|
||||||
$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)
|
||||||
|
{
|
||||||
|
# For a CI test run, we are only interested in validating one cmdlet to ensure that
|
||||||
|
# get-help <cmdletName> works.
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Describe "Validate that get-help <cmdletName> works" -Tags "CI" {
|
||||||
|
|
||||||
|
RunTestCase -tag "CI"
|
||||||
|
}
|
||||||
|
|
||||||
|
Describe "Validate Get-Help for all cmdlets in 'Microsoft.PowerShell.Core'" -Tags "Feature" {
|
||||||
|
|
||||||
|
RunTestCase
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue