mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
committed by
Travis Plunk
parent
4eb1494442
commit
c97ca777df
@@ -1,28 +1,37 @@
|
||||
if ( $IsWindows ) {
|
||||
$PesterSkipOrPending = @{ Skip = $true }
|
||||
}
|
||||
elseif ( $IsOSX ) {
|
||||
$PesterSkipOrPending = @{ Pending = $true }
|
||||
}
|
||||
else {
|
||||
$PesterSkipOrPending = @{}
|
||||
}
|
||||
Describe "NativeLinuxCommands" -tags "CI" {
|
||||
It "Should return a type of System.Object for hostname cmdlet" {
|
||||
(hostname).GetType().BaseType | Should Be 'System.Object'
|
||||
(hostname).GetType().Name | Should Be String
|
||||
}
|
||||
|
||||
It "Should find Application grep" -Skip:$IsWindows {
|
||||
It "Should find Application grep" @PesterSkipOrPending {
|
||||
(get-command grep).CommandType | Should Be Application
|
||||
}
|
||||
|
||||
It "Should pipe to grep and get result" -Skip:$IsWindows {
|
||||
It "Should pipe to grep and get result" @PesterSkipOrPending {
|
||||
"hello world" | grep hello | Should Be "hello world"
|
||||
}
|
||||
|
||||
It "Should find Application touch" -Skip:$IsWindows {
|
||||
It "Should find Application touch" @PesterSkipOrPending {
|
||||
(get-command touch).CommandType | Should Be Application
|
||||
}
|
||||
|
||||
It "Should not redirect standard input if native command is the first command in pipeline (1)" -Skip:$IsWindows {
|
||||
It "Should not redirect standard input if native command is the first command in pipeline (1)" @PesterSkipOrPending {
|
||||
stty | ForEach-Object -Begin { $out = @() } -Process { $out += $_ }
|
||||
$out.Length -gt 0 | Should Be $true
|
||||
$out[0] -like "speed * baud; line =*" | Should Be $true
|
||||
}
|
||||
|
||||
It "Should not redirect standard input if native command is the first command in pipeline (2)" -Skip:$IsWindows {
|
||||
It "Should not redirect standard input if native command is the first command in pipeline (2)" @PesterSkipOrPending {
|
||||
$out = stty
|
||||
$out.Length -gt 0 | Should Be $true
|
||||
$out[0] -like "speed * baud; line =*" | Should Be $true
|
||||
|
||||
Reference in New Issue
Block a user