Jameswtruher/travisdailybuild (#2958)

* Stifle progress output in build.psm1 for some operations

Modify test failure presentation to use platform available XML methods

* Add timeout support for returning runtime parsing errors

Some of the language/parser tests have been hanging in a non-reproducable manner which
causes the CI system to invalidate the entire run. This change adds support for timeout
which will fail a test if it runs to long, rather than invalidate the entire run.

current behavior is still supported, and is not done in a new session:
PS> get-runtimeerror -src '1/'
At line:1 char:3
+ 1/
+   ~
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

Adding a timeout will do the operation in a async powershell session
PS> get-runtimeerror -src '1/' -timeout 5
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

If the operation takes longer than the supplied timeout, a timeout error will be returned
PS> get-runtimeerror -src 'start-sleep 6' -timeout 2
get-runtimeerror : Operation Timed Out ('start-sleep 6')
At line:1 char:1
+ get-runtimeerror -src 'start-sleep 6' -timeout 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RuntimeError

* Modify native linux command tests to skip on Windows and pending on Mac

* remove verbose and progress output from help tests

* Be sure that Feature Counter tests only run on Windows

Also, only call add-type in CounterTestHelperFunctions.ps1 if we're going to actually run the tests

* do not run any get-computerinfo tests on non-windows systems

* suppress progress output from PowerShell Get tests

* remove -quiet from API and CRON Builds

Travis watches output from the build to ensure that it hasn't hung
we need to find a balance between too much output and not enough output.
A run which has too much output is killed because it looks like an error loop
A run which has too little output is killed because it looks like a hang

* Remove commented line in Import-Counter.Tests.ps1

Remove extraneous extra line in PowerShellGet.Tests.ps1

* Change `-as "type"` to `-as [type]` in build.psm1

Alter timeout to 10 seconds to be improve chances of not timing out for runtime parser checks
improve logic for counter tests to also skip for IoT

* use the existing function of SkipCounterTests rather than duplicate the logic in import-counter.tests.ps1
This commit is contained in:
James Truher [MSFT]
2017-01-10 14:42:27 -08:00
committed by Travis Plunk
parent 4eb1494442
commit c97ca777df
10 changed files with 111 additions and 41 deletions
@@ -1,4 +1,6 @@
Describe 'get-help HelpFunc1' -Tags "Feature" {
$ProgressPreference = "SilentlyContinue"
Describe 'get-help HelpFunc1' -Tags "Feature" {
BeforeAll {
function TestHelpError {
[CmdletBinding()]
@@ -22,7 +24,7 @@
It '$x.relatedLinks.navigationLink[0].uri' { $x.relatedLinks.navigationLink[0].uri | Should Be "http://blogs.msdn.com/powershell" }
It '$x.relatedLinks.navigationLink[1].linkText' { $x.relatedLinks.navigationLink[1].linkText | Should Be "other commands" }
It '$x.examples.example.code' { $x.examples.example.code | Should Be "If you need an example, you're hopeless." }
It '$x.inputTypes.inputType.type.name‘ { $x.inputTypes.inputType.type.name | Should Be "Anything you like." }
It '$x.inputTypes.inputType.type.name' { $x.inputTypes.inputType.type.name | Should Be "Anything you like." }
It '$x.returnValues.returnValue.type.name' { $x.returnValues.returnValue.type.name | Should Be "Nothing." }
It '$x.Component' { $x.Component | Should Be "Something" }
It '$x.Role' { $x.Role | Should Be "CrazyUser" }
@@ -555,4 +557,4 @@ Describe 'get-help other tests' -Tags "CI" {
It '$x.Parameters.parameter[1].defaultValue' { $x.Parameters.parameter[1].defaultValue | Should Be '42' }
It '$x.Parameters.parameter[2].defaultValue' { $x.Parameters.parameter[2].defaultValue | Should Be 'parameter is mandatory' }
}
}
}