For reliability, start using pester PassThru object to verify tests passed#4644
Conversation
There was a problem hiding this comment.
Unelevate cannot be used with PassThru. Just making sure no one tries. PassThru didn't even work anymore.
There was a problem hiding this comment.
I'll file an issue to move the Unelevated tests to use the same mechanism to verify that the tests passed, which should get rid of this.
There was a problem hiding this comment.
Looking at the code below, when TotalCount is 0 that means no test were run.
Will this where-object filter work as expected in this case (TotalCount is 0)?
There was a problem hiding this comment.
add a space between if and (
There was a problem hiding this comment.
add space between if and (
There was a problem hiding this comment.
add space between elseif and (
There was a problem hiding this comment.
add space between elseif and (
There was a problem hiding this comment.
add space between if and (
There was a problem hiding this comment.
add space between elseif and (
74b99ae to
cc04525
Compare
| try | ||
| { | ||
| $Command += "|Export-Clixml -Path '$passThruFile' -Force" | ||
| Start-NativeExecution -sb {& $powershell -noprofile -c $Command} | ForEach-Object { Write-Host $_} |
There was a problem hiding this comment.
Since all output from Invoke-Pester will be captured by Export-Clixml, what will be passed to Foreach-Object?
There was a problem hiding this comment.
Only the PassThru object is captured by Export-Clixml... everything else is done by a write host, but when we run another PowerShell process that gets turned into an output. Thus, the complexity ( I have to turn it back into a write-host)
| $pesterParam = @{ | ||
| 'binDir' = $output | ||
| 'PassThru' = $true | ||
| } |
There was a problem hiding this comment.
Why does this issue only happen to Travis CI? I assume it doesn't happen in AppVeyor as AppVeyor.psm1 is not chnaged to use the new parameter -PassThru.
There was a problem hiding this comment.
Due to the use of -Unelevate
There was a problem hiding this comment.
@anmenaga already asked a question, why I marked these two options as mutually exclusive. I plan on making the code paths more similar after this gets merged.
|
May be useful comment |
This should fix #4641.
Thanks, @markekraus for reporting.